gridx.core.Core
Object » gridx.core.Core
dojo.require("gridx.core.Core");
Defined in gridx/core/Core.js
This is the logical grid (also the base class of the grid widget), providing grid data model and defines a module/plugin framework so that the whole grid can be as flexible as possible while still convenient enough for web page developers.
Method Summary
- _arr(total, type, start, count, pid)
- _create(args)
- _initMod(deferredStartup, key)
- _load(deferredStartup)
- _mixin(component, name)
- _preload()
- _reset(args)
- _uninit()
- cell(row, column, isId, parentId) returns gridx.core.Cell|null Get a cell object
- column(column, isId) returns gridx.core.Column|null Get a column object by ID or index
- columnCount() returns Integer Get the number of columns
- columns(start, count) returns gridx.core.Column[] Get a range of columns, from index 'start' to index 'start + count'.
- row(row, isId, parentId) returns gridx.core.Row|null Get a row object by ID or index. For asyc store, if the data of this row is not in cache, then null will be returned.
- rowCount(parentId) returns Integer Get the number of rows.
- rows(start, count, parentId) returns gridx.core.Row[] Get a range of rows, from index 'start' to index 'start + count'.
- setColumns(columns) Change all the column definitions for grid.
- setStore(store) Change the store for grid.
Event Summary
- onModulesLoaded() Fired when all grid modules are loaded. Can be used as a signal of grid creation complete.
Methods
Returns gridx.core.Cell|null: If the params are valid and the row is in cache return a cell object, else return null.
Get a cell object
Parameter | Type | Description |
---|---|---|
row | gridx.core.Row|Integer|String | Row index or row ID or a row object |
column | gridx.core.Column|Integer|String | Column index or column ID or a column object |
isId | Boolean | Optional. If the row and coumn params are numeric IDs, set this to true |
parentId |
Returns gridx.core.Column|null: If the params are valid return a column object, else return NULL
Get a column object by ID or index
Parameter | Type | Description |
---|---|---|
column | Integer|String | Column index or column ID |
isId | Boolean | If the column parameter is a numeric ID, set this to true |
Returns gridx.core.Column[]: An array of column objects
Get a range of columns, from index 'start' to index 'start + count'.
Parameter | Type | Description |
---|---|---|
start | Integer | Optional. The index of the first column in the returned array.
If omitted, defaults to 0, so grid.columns() gets all the columns. |
count | Integer | Optional. The number of columns to return.
If omitted, all the columns starting from 'start' will be returned. |
Returns gridx.core.Row|null: If the params are valid and row data is in cache, return a row object, else return null.
Get a row object by ID or index.
For asyc store, if the data of this row is not in cache, then null will be returned.
Parameter | Type | Description |
---|---|---|
row | Integer|String | Row index of row ID |
isId | Boolean | Optional. If the row parameter is a numeric ID, set this to true |
parentId |
Returns Integer: The count of rows. -1 if the size info is not available (using server side store and never fetched any data)
For async store, the return value is valid only when the grid has fetched something from the store.
Parameter | Type | Description |
---|---|---|
parentId | String | Optional. If provided, return the child count of the given parent row. |
Returns gridx.core.Row[]: An array of row objects
For async store, if some rows are not in cache, then there will be NULLs in the returned array.
Parameter | Type | Description |
---|---|---|
start | Integer | Optional. The index of the first row in the returned array.
If omitted, defaults to 0, so grid.rows() gets all the rows. |
count | Integer | Optional. The number of rows to return.
If omitted, all the rows starting from 'start' will be returned. |
parentId |
Change all the column definitions for grid.
Parameter | Type | Description |
---|---|---|
columns | Array | The new column structure |
Change the store for grid.
Parameter | Type | Description |
---|---|---|
store | dojo.data.*|dojox.data.*|dojo.store.* | The new data store |