getColumnPosByIndex(colIndex: Number);
colIndex. Index of the table column, which position must be determined.
The getColumnPosByIndex method determines column's position in the table by its index.
This method returns a Number type value.
Column position corresponds to its index not considering table horizontal scrolling.
To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Scroll the table to the row with the index 1 and to the column with the index 2. Then determine positions of this row and this column in the table:
// Get table dimensions var measures = tabSheet.getMeasures(); // Determine table row and column indexes var rowIndex = 1; var colIndex = 2; // Scroll to particular row or column tabSheet.scrollToRow(rowIndex); tabSheet.scrollToColumn(colIndex); // Get row position with the specified index var rowPos = measures.getRowPosByIndex(rowIndex); console.log("Row position with the index " + rowIndex + ": " + rowPos); // Get column position with the specified index var columnPos = measures.getColumnPosByIndex(colIndex); console.log("Column position with the index " + colIndex + ": " + columnPos);
After executing the example the table is scrolled to row with the index 1 and column with the index 2:
The browser console shows positions of the given row and column in the table:
Position of the row with the index 1: 0
Position of the column with the index 2: 0
See also: