Constructor
new Grid(selector, template, optionsopt)
Creates a new grid instance.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
selector |
String | jQuery selector. | |
template |
String | The template selector. | |
options |
Object |
<optional> |
The options object to apply to the grid. |
Methods
- (static) count() → {Number}
- (static) db(dbopt) → {*}
- (static) drop() → {boolean}
- (static) from(dataSource) → {Grid}
- (static) insert()
- (static) name(valopt) → {Grid}
- (static) refresh()
- (static) remove()
- (static) state(valopt) → {Grid}
- (static) template(template) → {*}
- (static) update()
- (static) updateById()
- query(queryObj, queryOptions) → {Grid}
(static) count() → {Number}
Returns the number of documents currently in the grid.
Returns:
- Type
- Number
(static) db(dbopt) → {*}
Gets / sets the db instance this class instance belongs to.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
db |
Db |
<optional> |
The db instance. |
Returns:
- Type
- *
(static) drop() → {boolean}
Drops a grid and all it's stored data from the database.
Returns:
True on success, false on failure.
- Type
- boolean
(static) from(dataSource) → {Grid}
Sets the data source from which the grid will assemble its data.
Parameters:
| Name | Type | Description |
|---|---|---|
dataSource |
View | The data source to use to assemble grid data. |
Returns:
- Type
- Grid
(static) insert()
Executes an insert against the grid's underlying data-source.
(static) name(valopt) → {Grid}
Gets / sets the current name.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
val |
String |
<optional> |
The name to set. |
Returns:
- Type
- Grid
(static) refresh()
Refreshes the grid data such as ordering etc.
(static) remove()
Executes a remove against the grid's underlying data-source.
(static) state(valopt) → {Grid}
Gets / sets the current state.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
val |
String |
<optional> |
The name of the state to set. |
Returns:
- Type
- Grid
(static) template(template) → {*}
Gets / sets the grid's HTML template to use when rendering.
Parameters:
| Name | Type | Description |
|---|---|---|
template |
String | The template's jQuery selector. |
Returns:
- Type
- *
(static) update()
Executes an update against the grid's underlying data-source.
(static) updateById()
Executes an updateById against the grid's underlying data-source.
query(queryObj, queryOptions) → {Grid}
Sets the base query and query options on the grid that
will remain part of the query regardless of other changes.
Parameters:
| Name | Type | Description |
|---|---|---|
queryObj |
Object | The query object. |
queryOptions |
Object | The query options object. |
Returns:
- Type
- Grid