isColInsideVisibleRange(colIndex: Number);
colIndex. Table column index.
The isColInsideVisibleRange method determines whether specified column is within the visible table range.
This method returns True if the specified column is within the visible table range, otherwise it returns False.
To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Hide the row and column with index 2 in the table. Then determine whether the visible range includes the cell under coordinates (3, 3), columns D and E, and rows with the indexes 4 and 5. Also, check if the last row and last column in the visible range are the last not hidden row and column in the table:
// Get table dimensions var measures = tabSheet.getMeasures(); // Hide the row and column with index 2 if (!measures.isRowHidden(2)) { measures.addHiddenRow(2) }; if (!measures.isColumnHidden(2)) { measures.addHiddenColumn(2) }; // Refresh table tabSheet.rerender(); // Get information about table rows and column var coord = tabSheet.coord(2, 3); console.log("Coordinates (3, 3) in the visible range " + (measures.isCoordInsideVisibleRange(coord) ? "are included" : "are not included.")); console.log("The D column in the visible range " + (measures.isColInsideVisibleRange(4) ? "is included." : "is not included.")); console.log("The E column in the visible range " + (measures.isColInsideVisibleRange(5) ? "is included." : "is not included.")); var isLastVisibleColumn = measures.isLastVisibleColumnLastNonHidden() ? "is." : "is not."; console.log("The last column of visible range " + isLastVisibleColumn + " last non-hidden in table."); console.log("A row with index 4 in the visible range " + (measures.isRowInsideVisibleRange(4) ? "is included." : "is not included.")); console.log("A row with index 5 in the visible range " + (measures.isRowInsideVisibleRange(5) ? "is included." : "is not included.")); var isLastVisibleRow = measures.isLastVisibleRowLastNonHidden() ? "is." : "is not."; console.log("The last row of the visible range " + isLastVisibleRow + " last non-hidden in table.");
After executing the example the row and column with index 2 are hidden:
The browser console show whether the visible range includes the cell under coordinates (3, 3), columns D and E, and rows with the indexes 4 and 5, and also the information on whether the last row and last column in the visible range are the last not hidden in the table:
Coordinates (3, 3) are included into the visible range
The D column is included into the visible range.
The E column is not included into the visible range.
The last column of the visible range is not the last non-hidden column in the table.
The row with the index 4 is included into the visible range.
The row with the index 5 is not included into the visible range.
The last row of the visible range is not the last non-hidden row in the table.
See also: