GridView.HyperlinkMouseDown

Syntax

HyperlinkMouseDown: function(sender, args, timeout);

Parameters

sender. Event source.

args. Event information. Available arguments: rowIndex - index of the cell row, that contains the clicked hyperlink, colIndex - table column index for this cells, hyperlink - hyperlink object with the properties Action, ActionType, Color, Enable, Target, Text, Underline, event - event of clicking the hyperlink with the mouse.

timeout. Time delay (milliseconds) after which the event occurs.

Description

The HyperlinkMouseDown event occurs on clicking a hyperlink in the table.

Example

To execute the example, the HTML page must contain the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component) and with the loaded table in the express report workspace. Before executing this example the express report table looks as it is shown in the page with description of the GridView class.

Create a hyperlink, show it in the table cells, and process the even of hyperlink click HyperlinkMouseDown:

// Get express report table
var gridView = expressBox.getDataView().getGridView();
// Get table
var tabSheet = gridView.getTabSheet();
// Get cell with coordinate (1, 1)
var cell = tabSheet.getCell(1, 1);
// Get cell style
var style = cell.getStyle();
// Set hyperlink color, availability, style, text, URL
style.Hyperlink.Color = "#1A3DC1";
style.Hyperlink.Enable = true;
style.Hyperlink.Underline = true;
style.Hyperlink.Text = "Foresight";
style.Hyperlink.Action = "http://www.fsight.ru";
// Display hyperlink in cell
tabSheet.showHyperlinksOnRange([{
    type: PP.Ui.TabSheetHyperLinkShowType.All,
    range: tabSheet.getCell(1, 1)}
]);
// Redraw table
tabSheet.resetRange(tabSheet.getCell(1, 1));
// Handle the HyperlinkMouseDown event
tabSheet.HyperlinkMouseDown.add(function (sender, eventArgs) {
    // Display hyperlink information
    coords = (eventArgs.rowIndex, eventArgs.colIndex);        
    console.log("Coordinate of cell with hyperlink: (" + eventArgs.rowIndex + "," + eventArgs.colIndex + ")");        
    var hyperlink = eventArgs.hyperlink;        
    console.log("Text: " + hyperlink.Text);        
    console.log("Color: " + hyperlink.Color);        
    console.log("URL: " + hyperlink.Action);        
});

After executing the example a hyperlink is created and displayed in the table cell:

On clicking the hyperlink in the table cell, the console displays coordinates of this cell, color, text and URL of the hyperlink:

Coordinates of the cell with hyperlink: (1,1)

Text: Foresight

Color: #1A3DC1

URL: http://www.fsight.ru

See also:

GridView