gridx
Legend: Array Boolean Constructor Date DomNode Error Function Namespace Number Object RegExp Singleton String

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

_arr
ParameterTypeDescription
total
type
start
count
pid
_create
ParameterTypeDescription
args
_initMod
ParameterTypeDescription
deferredStartup
key
_load
ParameterTypeDescription
deferredStartup
_mixin
ParameterTypeDescription
component
name
_preload
_reset
ParameterTypeDescription
args
_uninit
cell
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
ParameterTypeDescription
rowgridx.core.Row|Integer|StringRow index or row ID or a row object
columngridx.core.Column|Integer|StringColumn index or column ID or a column object
isIdBoolean
Optional.
If the row and coumn params are numeric IDs, set this to true
parentId
column
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
ParameterTypeDescription
columnInteger|StringColumn index or column ID
isIdBooleanIf the column parameter is a numeric ID, set this to true
columnCount
Returns Integer: The count of columns
Get the number of columns
columns
Returns gridx.core.Column[]: An array of column objects
Get a range of columns, from index 'start' to index 'start + count'.
ParameterTypeDescription
startInteger
Optional.
The index of the first column in the returned array. If omitted, defaults to 0, so grid.columns() gets all the columns.
countInteger
Optional.
The number of columns to return. If omitted, all the columns starting from 'start' will be returned.
row
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.
ParameterTypeDescription
rowInteger|StringRow index of row ID
isIdBoolean
Optional.
If the row parameter is a numeric ID, set this to true
parentId
rowCount
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.

ParameterTypeDescription
parentIdString
Optional.
If provided, return the child count of the given parent row.
rows
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.

ParameterTypeDescription
startInteger
Optional.
The index of the first row in the returned array. If omitted, defaults to 0, so grid.rows() gets all the rows.
countInteger
Optional.
The number of rows to return. If omitted, all the rows starting from 'start' will be returned.
parentId
setColumns
Change all the column definitions for grid.
ParameterTypeDescription
columnsArrayThe new column structure
setStore
Change the store for grid.
ParameterTypeDescription
storedojo.data.*|dojox.data.*|dojo.store.*The new data store

Events

onModulesLoaded
Fired when all grid modules are loaded. Can be used as a signal of grid creation complete.