Skip to main content
Pentaho Documentation

ITable

pentaho.data.ITable

The ITable interface exposes the data and metadata of a tabular dataset.

Source: doc-js/pentaho/data/ITable.jsdoc, line 17

Methods

Name Description
filterMatchesRow(filter, rowIndex) : boolean

Gets a value that indicates if a given filter includes a given row.

getColumnId(colIndex) : string

Gets the id of a column, given its index.

getColumnIndexByAttribute(attr) : number

Gets the index of the first column having a given attribute.

getColumnLabel(colIndex) : string

Gets the label of a column, given its index.

getColumnType(colIndex) : string

Gets the type name of the values of a column's attribute, given its index.

getFormattedValue(rowIndex, colIndex) : string

Gets a best-effort formatted value of a cell, given its row and column indexes.

getLabel(rowIndex, colIndex) : string | undefined

Gets the formatted value property of a cell, given its row and column indexes.

getNumberOfColumns() : number

Gets the number of columns.

getNumberOfRows() : number

Gets the number of rows.

getValue(rowIndex, colIndex) : any | null

Gets the value of a cell, given its row and column indexes.

getValueKey(rowIndex, colIndex) : string

Gets the key of the value of a cell, given its row and column indexes.

Methods Details

filterMatchesRow(filter, rowIndex) : boolean

Gets a value that indicates if a given filter includes a given row.

Source: doc-js/pentaho/data/ITable.jsdoc, line 131

Parameters:
Name Default Value Summary
filter : pentaho.type.filter.Abstract

The filter.

rowIndex : number

The row index (zero-based).

Returns:
Name Description
boolean

true if the filter includes the row; false, otherwise.

Throws:
Name Description
pentaho.type.ValidationError

When the filter is not valid, the first error returned by the validate method.

getColumnId(colIndex) : string

Gets the id of a column, given its index.

Source: doc-js/pentaho/data/ITable.jsdoc, line 40

Parameters:
Name Default Value Summary
colIndex : number

The column index (zero-based).

Returns:
Name Description
string

The id of the column.

getColumnIndexByAttribute(attr) : number

Gets the index of the first column having a given attribute.

Source: doc-js/pentaho/data/ITable.jsdoc, line 145

Parameters:
Name Default Value Summary
attr : string

The name of an attribute.

Returns:
Name Description
number

The (0-based) index of the column having the specified attribute, if any, or -1, if none.

getColumnLabel(colIndex) : string

Gets the label of a column, given its index.

Source: doc-js/pentaho/data/ITable.jsdoc, line 49

Parameters:
Name Default Value Summary
colIndex : number

The column index (zero-based).

Returns:
Name Description
string

The label of the column.

getColumnType(colIndex) : string

Gets the type name of the values of a column's attribute, given its index.

Source: doc-js/pentaho/data/ITable.jsdoc, line 58

Parameters:
Name Default Value Summary
colIndex : number

The column index (zero-based).

Returns:
Name Description
string

The type name.

getFormattedValue(rowIndex, colIndex) : string

Gets a best-effort formatted value of a cell, given its row and column indexes.

If the cell has a specified label, then the string representation of that value is returned.

Otherwise, if the cell has a specified value, then the string representation of that value is returned.

When both the cell's formatted value and value are null or undefined, then an empty string is returned.

Contrast this method with pentaho.data.ITable#getLabel, that only returns a formatted value when one has been explicitly defined in the cell's f property.

Source: doc-js/pentaho/data/ITable.jsdoc, line 108

Parameters:
Name Default Value Summary
rowIndex : number

The row index (zero-based).

colIndex : number

The column index (zero-based).

Returns:
Name Description
string

The cell's formatted value.

getLabel(rowIndex, colIndex) : string | undefined

Gets the formatted value property of a cell, given its row and column indexes.

This method returns the string representation of the value of the cell's f property, when the value is defined, or undefined, otherwise.

Contrast this method with pentaho.data.ITable#getFormattedValue, that returns a best-effort formatted value in all cases.

Source: doc-js/pentaho/data/ITable.jsdoc, line 92

Parameters:
Name Default Value Summary
rowIndex : number

The row index (zero-based).

colIndex : number

The column index (zero-based).

Returns:
Name Description
string | undefined

The specified formatted value or undefined.

getNumberOfColumns() : number

Gets the number of columns.

Source: doc-js/pentaho/data/ITable.jsdoc, line 24

Returns:
Name Description
number

The number of columns.

getNumberOfRows() : number

Gets the number of rows.

Source: doc-js/pentaho/data/ITable.jsdoc, line 32

Returns:
Name Description
number

The number of rows.

getValue(rowIndex, colIndex) : any | null

Gets the value of a cell, given its row and column indexes.

When a cell is missing or has a null or undefined value, then null is returned.

Source: doc-js/pentaho/data/ITable.jsdoc, line 67

Parameters:
Name Default Value Summary
rowIndex : number

The row index (zero-based).

colIndex : number

The column index (zero-based).

Returns:
Name Description
any | null

The cell's value.

getValueKey(rowIndex, colIndex) : string

Gets the key of the value of a cell, given its row and column indexes.

When a cell contains the null value, its key is the empty string, "".

Source: doc-js/pentaho/data/ITable.jsdoc, line 80

Parameters:
Name Default Value Summary
rowIndex : number

The row index (zero-based).

colIndex : number

The column index (zero-based).

Returns:
Name Description
string

The key of the cell's value.