TabSheetModel.getCells

Syntax

getCells();

Description

The getCells method gets all table cells.

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 an array that contains all the table cells and add the plus sign + to value of each cell in this range:

// Get table data model
var model = tabSheet.getModel();
// Get table cells
var cells = model.getCells();
// Add the + character for each cell in the array
for (var i = 0; i < cells.length; i++) {
  var coord = cells[i].getCoord();
  tabSheet.setCellValue("+" + cells[i].CellData.FormattedText, coord.rowIndex, coord.colIndex) 
};
var cell = model.getCell(0);
console.log(cell.CellData.FormattedText);

After executing the example the plus sign + is added to value of each cell in the table:

See also:

TabSheetModel