TabSheet.getCoordUnderMouse

Syntax

getCoordUnderMouse(event: MouseEvent, touchEvent: MouseEvent);

Parameters

event. Mouse cursor movement event. Optional parameter. By default it equals to Null;

touchEvent. Mouse button click event. Optional parameter. By default it is set to Null.

Description

The getCoordUnderMouse method gets the current coordinate under the mouse.

Comments

This method returns an object of the PP.Ui.TabSheetCoord type.

Example

To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Process the mouse movement event MouseMove, while showing coordinates that correspond to cells under the cursor:

// Process the MouseMove event
tabSheet.MouseMove.add(function (sender, eventArgs) {    
    var e = eventArgs.Event;
    // Get coordinates of the cell by the current cursor position 
    var coord = tabSheet.getCoordUnderMouse(e);
    var info = tabSheet.getCoordInfo(coord);
    console.log("Coordinates: (" + coord.rowIndex + ", " + coord.colIndex + ")");
    console.log("  Whether cell is merged: " + info.cellspan);
    console.log("  Whether column header is fit: " + info.colHeader);
    console.log("  Whether row header is fit: " + info.rowHeader);
  
});

After executing the example on moving the mouse cursor over the table, the browser console shows information on the coordinates that correspond to cells under this cursor:

Coordinates: (-1, 1)
  Is the cell merged: False
  Is the cell included into column header: True
  Is the cell included into row header: False
Coordinates: (0, 1)
  Is the cell merged: False
  Is the cell included into column header: False
  Is the cell included into row header: False

See also:

TabSheet