BiAbstractGrid

The abstract base class for the grid and the tree.

This class extends BiComponent and therefore all methods and fields available for BiComponent are also available for BiAbstractGrid .

Constructor

new BiAbstractGrid ( )

Parameters

No parameters.

Properties

NameTypegetsetDescripton
allowInlineFindBooleancheckedcheckedWhen true, typing a word will select the first matching item.
ascendingBooleancheckedWhether to sort the grid ascending or descending. Use the sort method to change the ascending property.
columnAlignsString[]checkedcheckedAn array containing the text aligns for the columns.
columnCountNumbercheckedcheckedThe number of columns to show in the grid.
columnNamesString[]checkedcheckedAn array containing the names for the columns. The names are used for the text on the column header.
columnOrdersNumber[]checkedcheckedAn array containing the orders of the columns. A value of [2, 0, 1] means that the third column should be displayed left most and the second column right most.
columnsBiGridColumn[]checkedAn array containing the column objects used for the grid.
columnSortTypesString[]checkedcheckedAn array containing the sort types for the columns. Valid values can be found in the documentation for the BiGridColumn sortType.
columnWidthsNumber[]checkedcheckedAn array containing the widths of the columns.
fitColumnWidthsBooleancheckedcheckedWhen this is true the columns will be sized horizontally so that they fill the grid viewport
fontSizeNumbercheckedcheckedThe font size of all text in the grid
gridBodyHtmlStringcheckedGenerates the HTML code used to display the grid body.
headersBiGridHeaderscheckedThe component containing the grid headers.
headersHeightNumbercheckedcheckedThe height of the headers.
iconColumnNumbercheckedcheckedThe column to show the icon on. Setting this to -1 (or a value greater than the column count) removes the icons.
liveResizeBooleancheckedcheckedWhen this is set to true the column size in the grid body is updated as the user resizes the headers. If this is false the column size in the body is only updated as the user finishes the resize of the column header.
multipleSelectionBooleancheckedcheckedWhether to allow multiple selection.
rowHeadersWidthNumbercheckedcheckedThe width of the row headers that can be shown when using a grid.
rowHeightNumbercheckedcheckedThe height of each row in the grid.
selectedNodeBiAbstractGridRow / BiGridCellcheckedReturns the first selected grid row (or cell). This is same as grid.getSelectedNodes()[0]. Same as selectedRow.
selectedNodesBiAbstractGridRow[] / BiGridCell[]checkedReturns the selected grid rows or grid cells if cell selection is used. Same as selectedRows.
selectedRowBiAbstractGridRow / BiGridCellcheckedReturns the first selected grid row (or cell). This is same as grid.getSelectedNodes()[0].
selectedRowsBiAbstractGridRow[] / BiGridCell[]checkedReturns the selected grid rows or grid cells if cell selection is used.
selectionModelBiSelectionModelcheckedcheckedThis handles the selection of the rows in the grid.
showHeadersBooleancheckedcheckedWhether to show the headers on the grid.
showRowHeadersBooleancheckedcheckedWhether to show the row headers on the grid.
sortColumnNumbercheckedThe column to sort the grid by. Use the sort method to update the sort column.

Methods

NameDescription
findStringSearches the rows for a row that starts with the given string. This match is case insensitive. If no item is found this returns null. For a tree this does not include hidden children of collapsed nodes.
findStringExactSearches the rows for a row that matches the given string. This match is case insensitive. If no item is found this returns null. For a tree this does not include hidden children of collapsed nodes.
getColumnAlignReturns the text align for the column.
getColumnNameReturns the name of the column.
getColumnOrderReturns the column order index for the column. If columnOrders is [2, 0, 1] then getColumnOrder(1) will return 2.
getColumnSortTypeReturns the sort type of the column.
getColumnWidthReturns the column width for the column.
sortSorts the grid by the given column
updateUpdates both the columns and the data.
updateColumnsUpdates the column widths by regenerating the styleText. This should be called before the first draw of the grid and it should be called if the columns widths, column align or the indent column is changed.
updateDataRedraws the data by regenerating the gridBodyHtml. This should be called before the first draw of the grid and it should be called when changes to the data has occurred. It should also be called when the icon column or the indent column is changed.
updateHeadersWidthUpdates the width of the grid headers. This can be called if the size of the headers becomes dirty.

Events

NameTypeBubblesDescripton
beforesortBiEventFires before the sort happens. Call preventDefault to prevent the sorting.
sortBiEventFires after the grid has been sorted.

Static Methods

None.

Static Fields

None.

Remarks

This class is abstract and should not be instantiated.

Method Details

findString

Searches the rows for a row that starts with the given string. This match is case insensitive. If no item is found this returns null. For a tree this does not include hidden children of collapsed nodes.

Syntax

object.findString ( sText [ ,nStartIndex ] )

Parameters

NameTypeOptionalDefaultDescripton
sTextStringThe text to search for
nStartIndexNumberchecked0 The index to start the searching from

Return Type

BiAbstractRow

findStringExact

Searches the rows for a row that matches the given string. This match is case insensitive. If no item is found this returns null. For a tree this does not include hidden children of collapsed nodes.

Syntax

object.findStringExact ( sText [ ,nStartIndex ] )

Parameters

NameTypeOptionalDefaultDescripton
sTextStringThe text to search for
nStartIndexNumberchecked0 The index to start the searching from

Return Type

BiAbstractGridRow

getColumnAlign

Returns the text align for the column.

Syntax

object.getColumnAlign ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column to get the text align for

Return Type

String

getColumnName

Returns the name of the column.

Syntax

object.getColumnName ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column to get the name for.

Return Type

String

getColumnOrder

Returns the column order index for the column. If columnOrders is [2, 0, 1] then getColumnOrder(1) will return 2.

Syntax

object.getColumnOrder ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column to get the order index for.

Return Type

Number

getColumnSortType

Returns the sort type of the column.

Syntax

object.getColumnSortType ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column to get the sort type for

Return Type

String

getColumnWidth

Returns the column width for the column.

Syntax

object.getColumnWidth ( x )

Parameters

NameTypeOptionalDefaultDescripton
xNumberThe column to get the width for.

Return Type

Number

sort

Sorts the grid by the given column

Syntax

object.sort ( nCol [ ,bAscending ] )

Parameters

NameTypeOptionalDefaultDescripton
nColNumberThe column to sort by
bAscendingBooleancheckedfalse Sorting ascending or descending

Return Type

void

update

Updates both the columns and the data.

Syntax

object.update ( )

Parameters

No arguments.

Return Type

void

updateColumns

Updates the column widths by regenerating the styleText. This should be called before the first draw of the grid and it should be called if the columns widths, column align or the indent column is changed.

Syntax

object.updateColumns ( )

Parameters

No arguments.

Return Type

void

updateData

Redraws the data by regenerating the gridBodyHtml. This should be called before the first draw of the grid and it should be called when changes to the data has occurred. It should also be called when the icon column or the indent column is changed.

Syntax

object.updateData ( )

Parameters

No arguments.

Return Type

void

updateHeadersWidth

Updates the width of the grid headers. This can be called if the size of the headers becomes dirty.

Syntax

object.updateHeadersWidth ( )

Parameters

No arguments.

Return Type

void