BiGrid
This component is used to display a grid (table, column list). A grid can show headers for both the columns and the rows. A grid also supports selection of whole rows as well as of individual cells.
This class extends
BiAbstractGrid
and therefore all methods and fields available for
BiAbstractGrid
are also available for
BiGrid
.
Constructor
new
BiGrid
(
[
oGridData,oColumnNames
]
)
Parameters
| Name | Type | Optional | Default | Descripton |
oGridData |
Object[][] |
![]() |
The initial data. This should be a 2-dimensional array (an array of arrays) containing the data. The items in the array are passed
to the grid row and then to the
grid cell. |
|
oColumnNames |
String[] |
An array containt the names of the columns in the grid. |
Properties
| Name | Type | get | set | Descripton |
currentDataPage |
Number |
![]() |
![]() |
The index of the current data page. |
dataPageCount |
Number |
![]() |
The number of data pages that are available. This is the numbers of rows in the data set divided by the number of rows per page. | |
dataPageSize |
Number |
![]() |
![]() |
The amount of rows to show at one time from the data source. |
dataSource |
|
![]() |
![]() |
The object to use as the data source. This can be a either a
BiDataTable or a BiDataSet (in which case the first table is used). |
firstRow |
|
![]() |
Returns the first row. | |
headerCorner |
|
![]() |
This is the component that is shown in the upper left corner of the grid when both headers and row headers are shown. | |
lastRow |
|
![]() |
Returns the last row. | |
rowHeaders |
|
![]() |
The component responsible for drawing the grid row headers | |
rowHeadersHtml |
String |
![]() |
Returns the HTML needed for the row headers | |
rows |
|
![]() |
Returns all the rows. | |
selectionMode |
String |
![]() |
![]() |
Sets the selection mode. Allowed values are "cell" and "row". |
Methods
| Name | Description |
addRow |
Adds a grid row to the grid |
createItemFromDataRow |
This method is called when using data binding. This is used to
create a new BiGridRow from a BiDataRow. |
dataBind |
If the grid has a dataSource then this binds that
data source to the list. |
getCellAtPoint |
Returns the grid cell at the given point. If no cell is found this returns null. |
getRowAtPoint |
Returns the grid row at the given point. If no row is found this returns null. |
hasRows |
Returns true if the grid has any rows |
removeAll |
Removes and disposes all rows from the grid |
removeRow |
Removes a grid row. Returns the removed row. |
removeRowAt |
Removes the grid row at the given index. Returns the removed row. |
updateRowHeadersHeight |
Updates the height of the row headers |
Events
| Name | Type | Bubbles | Descripton |
change |
|
Fires when the selected row/cell changes | |
databind |
|
Called after the component has been data bound |
Static Methods
None.
Static Fields
None.
Remarks
After changing the data call updateData to redraw the body of the grid. When the columns have been changed you should call updateColumns.
Method Details
addRow
Adds a grid row to the grid
Syntax
object.addRow ( oChild [ ,oBefore ] )
Parameters
| Name | Type | Optional | Default | Descripton |
oChild |
|
The grid row child to add | ||
oBefore |
|
![]() |
If provided, the child is added before this row |
Return Type
void
createItemFromDataRow
This method is called when using data binding. This is used to
create a new BiGridRow from a BiDataRow.
Syntax
object.createItemFromDataRow
(
oRow
)
Parameters
| Name | Type | Optional | Default | Descripton |
oRow |
|
This is the row to create a new BiGridRow from. |
Return Type
dataBind
If the grid has a dataSource then this binds that
data source to the list.
Syntax
object.dataBind ( )
Parameters
No arguments.
Return Type
void
getCellAtPoint
Returns the grid cell at the given point. If no cell is found this returns null.
Syntax
object.getCellAtPoint ( nClientX,nClientY )
Parameters
| Name | Type | Optional | Default | Descripton |
nClientX |
Number |
The left position relative to the browser window | ||
nClientY |
Number |
The top position relative to the browser window |
Return Type
getRowAtPoint
Returns the grid row at the given point. If no row is found this returns null.
Syntax
object.getRowAtPoint ( nClientX,nClientY )
Parameters
| Name | Type | Optional | Default | Descripton |
nClientX |
Number |
The left position relative to the browser window | ||
nClientY |
Number |
The top position relative to the browser window |
Return Type
hasRows
Returns true if the grid has any rows
Syntax
object.hasRows ( )
Parameters
No arguments.
Return Type
Boolean
removeAll
Removes and disposes all rows from the grid
Syntax
object.removeAll ( )
Parameters
No arguments.
Return Type
void
removeRow
Removes a grid row. Returns the removed row.
Syntax
object.removeRow
(
oChild
)
Parameters
| Name | Type | Optional | Default | Descripton |
oChild |
|
The row to remove |
Return Type
removeRowAt
Removes the grid row at the given index. Returns the removed row.
Syntax
object.removeRowAt
(
i
)
Parameters
| Name | Type | Optional | Default | Descripton |
i |
Number |
The index of the row to remove |
Return Type
updateRowHeadersHeight
Updates the height of the row headers
Syntax
object.updateRowHeadersHeight ( )
Parameters
No arguments.
Return Type
void
