TabSheetModel.getColumnCells

Syntax

getColumnCells(colIndexes: Array, includeDefault: Boolean, startRowIndex: Number, endRowIndex: Number);

Parameters

colIndexes. Array of table column indexes.

includeDefault. Indicates whether default cells should be included into selection. If the parameter is True these cells are included into selection.

startRowIndex. Index of the first row in selection of cells in specified columns.

endRowIndex. Index of the last row in selection of cells in specified columns.

Description

The getColumnCells method gets array of cells in specified columns and specified range of table rows.

Comments

This method gets an array which elements are arrays of table cells that are PP.Ui.TabSheetCell type objects. Indexes of nested arrays must match row indexes, indexes of the items representing cells must correspond to their coordinates in the table.

Example

To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Get coordinates and values for the cells in the columns with indexes 0 and 1, positioned within the range of rows with indexes from 0 to 1 (inclusive):

// Get table data model
var model = tabSheet.getModel();
// get cells from the column with the indexes 0 and 1 inside the range of rows with the indexes from 0 to 2
var columnCells = model.getColumnCells([0, 1], True, 0, 1);
// Output information about the obtained cells
for (var i in columnCells) {
    var rows = columnCells[i];
    for (var j in rows) {
        var cell = rows[j];
        // Determine cell coordinates
        var coord = cell.getCoord();
        console.log("Cell value: (" + coord.rowIndex + ", " + coord.colIndex + "): " + cell.CellData.FormattedText)
    }
};

After executing the example the browser console shows coordinates and values of cells contained in columns with indexes 0 and 1 and within the range of rows with indexes from 0 to 1:

Cell value: (0, 0): 16905
Cell value: (0, 1): 3912
Cell value: (1, 0): 19281
Cell value: (1, 1): 5315

See also:

TabSheetModel