DataGridSelection.getSelectedAreas

Syntax

getSelectedAreas();

Description

The getSelectedAreas method returns array of all table selection areas.

Comments

The method returns arrays of object with the following fields:

Example

To execute the example, the HTML page must contain the DataGrid named grid (see Example of Creating the DataGrid Component). Hold down the CTRL key and select the table rows with the 1, 3 and 5 number.

Remove one of the selection areas:

// Get table selection object
var selection = grid.getSelection();
// Get table selection areas
var areas = selection.getSelectedAreas();
// Check if there is selection area with the 1 index
if (areas && areas.length > 1) {
    // Remove selection area
    selection.removeArea(areas[1]);
}

After executing the example the selection area that corresponds to the row with the 3 number is removed:

See also:

DataGridSelection