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
| Name | Type | get | set | Descripton |
allowInlineFind |
Boolean |
![]() |
![]() |
When true, typing a word will select the first matching item. |
ascending |
Boolean |
![]() |
Whether to sort the grid ascendingly or descendingly. Use the
sort method to change the ascending property. |
|
columnAligns |
String[] |
![]() |
![]() |
An array containing the text aligns for the columns. |
columnCount |
Number |
![]() |
![]() |
The number of columns to show in the grid. |
columnNames |
String[] |
![]() |
![]() |
An array containing the names for the columns. The names are used for the text on the column header. |
columnOrders |
Number[] |
![]() |
![]() |
An 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. |
columns |
|
![]() |
An array containing the column objects used for the grid. | |
columnSortTypes |
String[] |
![]() |
![]() |
An array containg the sort types for the columns. Valid values can
be found in the documentation for the BiGridColumn
sortType. |
columnWidths |
Number[] |
![]() |
![]() |
An array containing the widths of the columns. |
fitColumnWidths |
Boolean |
![]() |
![]() |
When this is true the columns will be sized horizontally so that they fill the grid viewport |
gridBodyHtml |
String |
![]() |
Generates the HTML code used to display the grid body. | |
headers |
|
![]() |
The component containing the grid headers. | |
headersHeight |
Number |
![]() |
![]() |
The height of the headers. |
iconColumn |
Number |
![]() |
![]() |
The column to show the icon on. Setting this to -1 (or a value greater than the column count) removes the icons. |
liveResize |
Boolean |
![]() |
![]() |
When 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. |
multipleSelection |
Boolean |
![]() |
![]() |
Whether to allow multiple selection. |
rowHeadersWidth |
Number |
![]() |
![]() |
The width of the row headers that can be shown when using a grid. |
rowHeight |
Number |
![]() |
![]() |
The height of each row in the grid. |
selectedNode |
|
![]() |
Returns the first selected grid row (or cell).
This is same as grid.getSelectedNodes()[0].
Same as selectedRow. |
|
selectedNodes |
|
![]() |
Returns the selected grid rows or grid cells if cell selection is used.
Same as selectedRows. |
|
selectedRow |
|
![]() |
Returns the first selected grid row (or cell).
This is same as grid.getSelectedNodes()[0]. |
|
selectedRows |
|
![]() |
Returns the selected grid rows or grid cells if cell selection is used. | |
selectionModel |
|
![]() |
![]() |
This handles the selection of the rows in the grid. |
showHeaders |
Boolean |
![]() |
![]() |
Whether to show the headers on the grid. |
showRowHeaders |
Boolean |
![]() |
![]() |
Whether to show the row headers on the grid. |
sortColumn |
Number |
![]() |
The column to sort the grid by. Use the sort
method to update the sort column. |
Methods
| Name | Description |
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. |
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. |
getColumnAlign |
Returns the text align for the column. |
getColumnName |
Returns the name of the column. |
getColumnOrder |
Returns the column order index for the column. If columnOrders
is [2, 0, 1] then getColumnOrder(1) will
return 2. |
getColumnSortType |
Returns the sort type of the column. |
getColumnWidth |
Returns the column width for the column. |
sort |
Sorts the grid by the given column |
update |
Updates both the columns and the data. |
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. |
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 occured. It should
also be called when the icon column or the indent column is
changed. |
updateHeadersWidth |
Updates the width of the grid headers. This can be called if the size of the headers becomes dirty. |
Events
| Name | Type | Bubbles | Descripton |
beforesort |
|
Fires before the sort happens. Call
preventDefault
to prevent the sorting. |
|
sort |
|
Fires 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
| Name | Type | Optional | Default | Descripton |
sText |
String |
The text to search for | ||
nStartIndex |
Number |
![]() |
0 |
The index to start the searching from |
Return Type
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
| Name | Type | Optional | Default | Descripton |
sText |
String |
The text to search for | ||
nStartIndex |
Number |
![]() |
0 |
The index to start the searching from |
Return Type
getColumnAlign
Returns the text align for the column.
Syntax
object.getColumnAlign
(
x
)
Parameters
| Name | Type | Optional | Default | Descripton |
x |
Number |
The column to get the text align for |
Return Type
String
getColumnName
Returns the name of the column.
Syntax
object.getColumnName
(
x
)
Parameters
| Name | Type | Optional | Default | Descripton |
x |
Number |
The 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
| Name | Type | Optional | Default | Descripton |
x |
Number |
The column to get the order index for. |
Return Type
Number
getColumnSortType
Returns the sort type of the column.
Syntax
object.getColumnSortType
(
x
)
Parameters
| Name | Type | Optional | Default | Descripton |
x |
Number |
The column to get the sort type for |
Return Type
String
getColumnWidth
Returns the column width for the column.
Syntax
object.getColumnWidth
(
x
)
Parameters
| Name | Type | Optional | Default | Descripton |
x |
Number |
The column to get the width for. |
Return Type
Number
sort
Sorts the grid by the given column
Syntax
object.sort ( nCol [ ,bAscending ] )
Parameters
| Name | Type | Optional | Default | Descripton |
nCol |
Number |
The column to sort by | ||
bAscending |
Boolean |
![]() |
false |
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 occured. 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
