FirstVisibleRow: Number;
The FirstVisibleRow property determines index of the first visible table row.
Use JSON or the setFirstVisibleRow method to set the property value and the getFirstVisibleRow method to get the property value.
Default property value is 0.
To execute the example, the HTML page must contain the DataGrid component named grid (see Example of Creating the DataGrid Component). Set index of the first visible table cell. Them determine indexes of all visible table cells and separately of the last visible row:
// Outputs indexes of only visible table rows function printRenderedRowIndexes() { var rowIndexes = grid.getRenderedRowIndexes(True); console.log("Indexes of visible rows: %s", rowIndexes.toString()); } // Output index of the last visible table row function printLastVisibleRowIndex() { var lastRow = grid.getLastVisibleRow(); console.log("Index of the last visible table row: %s", lastRow); } // The first visible row has the 3 index grid.setFirstVisibleRow(3); // Display only visible rows grid.renderVisibleRows(); // Determine indexes of only visible table rows printRenderedRowIndexes(); // Determine index of the last visible table row printLastVisibleRowIndex();
After executing the example index of the first visible row equal to 3 is set for table:
The browser console displays indexes of only visible table rows, as well as index of the last visible row:
Indexes of visible rows: 3,4,5,6,7,8,9
Index of the last visible table row: 9
See also: