TabSheetMeasures.calcColumnsWidthByPosition

Syntax

calcColumnsWidthByPosition(startColPos: Number, endColPos: Number, action: function, context: Object, isVirtual: Boolean, reverseCalc: Boolean);

Parameters

startColPos. Index of the column corresponding to range start.

endColPos. Index of the column corresponding to range end.

action. Function executed at each iteration of columns' total width calculation. This is an optional parameter, by default it is set to Null.

context. Context from which the method is called. This is an optional parameter, by default it equals to the current context of this.

isVirtual. Indicates if virtual or real coordinates are used. If the parameter is set to True, virtual coordinates are used, otherwise real coordinates are used. This is an optional parameter, by default it is set to False.

reverseCalc. Characteristic indicating direction of iteration through columns. If the parameter is set to True, method iterates starting from the range end to its start, if the parameter is False, iteration moves from start to the end of range. This is an optional parameter, by default it is set to False.

Description

The calcColumnsWidthByPosition method calculates total width of columns in a specified range.

Comments

This method returns a Number type value.

Example

To execute the example, the HTML page must contain the TabSheet component named tabSheet (see Example of Creating the TabSheet Component). Find total width of table columns in the range A0-C0 and total width of rows in the range A0-A2:

// Get table dimensions
var measures = tabSheet.getMeasures();
// Get value of column total width in the range A0-C0
var columnsWidth = measures.calcColumnsWidthByPosition(0, 2);
console.log("Column total width in the range A0-C0: " + columnsWidth);
// Get value of crow total height in the range A0-A2
var rowsHeight = measures.calcRowsHeightByPosition(0, 2);
console.log("Row total height in the range A0-A3: " + rowsHeight);

After executing the example the browser console shows values of total width of the columns in the range A0-B2 and total height of rows in the range A0-A2:

Total width of columns in the range A0-C0: 300

Total height of rows in the range A0-A3: 150

See also:

TabSheetMeasures