getSelectedAreas();
The getSelectedAreas method returns array of all table selection areas.
The method returns arrays of object with the following fields:
Nodes. Array of DOM element nodes related with the selected row.
Row. Selected row index.
RowRectangles. Array of table rectangles related with the selected row. Array elements are objects of the PP.Ui.DataGridRectangle type.
Type. Row that is a type of selected area.
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: