getMeasures();
The getMeasures method returns table dimensions.
This method returns an object of the PP.Ui.TabSheetMeasures type.
To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Get coordinates of cells around the B1 cell:
// Get table data model var model = tabSheet.getModel(); // Get table model dimensions var measures = model.getMeasures(); // Set cell coordinates var coord = tabSheet.coord(1, 1); // Get the cell located one row up of the basic cell var cell = model.getNextTopCell(coord); console.log("Top cell: (" + cell.getCoord().rowIndex + ", " + cell.getCoord().colIndex + ")"); // Get the cell located to the right of the specified cell var cell = model.getNextRightCell(coord); console.log("Cell to the right: (" + cell.getCoord().rowIndex + ", " + cell.getCoord().colIndex + ")"); // Get the cell located one row down of the specified cell var cell = model.getNextBottomCell(coord); console.log("Bottom cell: (" + cell.getCoord().rowIndex + ", " + cell.getCoord().colIndex + ")"); // Get the cell located to the left of the specified cell var cell = model.getNextLeftCell(coord); console.log("Cell to the left: (" + cell.getCoord().rowIndex + ", " + cell.getCoord().colIndex + ")");
After executing the example the browser console shows coordinates of the cells at the top, right, bottom and left of the cell under coordinates (1, 1):
Top cell: (0, 1)
Right cell: (1, 2)
Bottom cell: (2, 1)
Left cell: (1, 0)
See also: