TabSheet.calcNonSpanCoordUnderMouse

Syntax

calcNonSpanCoordUnderMouse(event: MouseEvent, touchEvent: MouseEvent);

Parameters

event. Mouse cursor movement event.

touchEvent. Mouse button click event.

Description

The calcNonSpanCoordUnderMouse method returns coordinates of the cell under the current mouse cursor position, ignoring cell spans.

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 cursor movement event MouseMove, showing coordinates of cells under the cursor, ignoring the cell span , but the cells must be inside the span:

// Get a cell range by the specified coordinates
var range = tabSheet.getRange(0, 1, 1, 0);
// Merge cells by the obtained range
tabSheet.merge(range)
// Process the MouseMove event
tabSheet.MouseMove.add(function (sender, eventArgs) {            
    var e = eventArgs.Event            
    /* Get coordinates of the cell in the current position of the cursor 
    without considering the cell span  */
    var coord = tabSheet.calcNonSpanCoordUnderMouse(e);
    if (tabSheet.getCellSpanUnderCoord(coord)) {
        // Output the obtained coordinates
        console.log("Cell coordinates: (" + coord.colIndex + ", " + coord.rowIndex + ")");
    }
});

After executing the example when the user moves cursor over the range of selected cells, the browser console shows coordinates of the cells included into the span, but ignoring this span:

Cell coordinates: (0, 0)
Cell coordinates: (1, 0)
Cell coordinates: (1, 1)

See also:

TabSheet