GlobalRowIndex: Number;
The GlobalRowIndex property determines global row index.
Use JSON to set the property value and the getGlobalRowIndex method to get the property value.
To execute the example, the HTML page must contain the DataGrid component named grid (see Example of Creating the DataGrid Component). Sort rows by values of the Identifier column. Get position of the row with the 5 index:
// Enable sorting by values of the Identifier column grid.getMeasures().getColumns()[3].setEnableSort(True); // Sort rows by values of the Identifier column grid.sort([{ dir: "ASC", column: "id" }]); // Get position of the row with the 5 global index for (var i in grid.getRows()) { if (grid.getRows()[i].getGlobalRowIndex() == 5) { console.log("Position of the row with the 5 global index: " + grid.getRows()[i].getRealRowIndex()); } }
As a result, table rows are sorted by values of the Identifier column:
The console displays position of the row with the 5 global index:
Position of the row with the 5 global index: 4
See also: