Class: Grid

Grid

Grid

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.
Source:

Methods

(static) count() → {Number}

Returns the number of documents currently in the grid.
Source:
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.
Source:
Returns:
Type
*

(static) drop() → {boolean}

Drops a grid and all it's stored data from the database.
Source:
Returns:
True on success, false on failure.
Type
boolean

(static) from(collection) → {Grid}

Sets the collection from which the grid will assemble its data.
Parameters:
Name Type Description
collection Collection The collection to use to assemble grid data.
Source:
Returns:
Type
Grid

(static) insert()

Executes an insert against the grid's underlying data-source.
Source:

(static) name(valopt) → {Grid}

Gets / sets the current name.
Parameters:
Name Type Attributes Description
val String <optional>
The name to set.
Source:
Returns:
Type
Grid

(static) refresh()

Refreshes the grid data such as ordering etc.
Source:

(static) remove()

Executes a remove against the grid's underlying data-source.
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.
Source:
Returns:
Type
Grid

(static) template(template) → {*}

Gets / sets the grid's HTML template to use when rendering.
Parameters:
Name Type Description
template Selector The template's jQuery selector.
Source:
Returns:
Type
*

(static) update()

Executes an update against the grid's underlying data-source.
Source:

(static) updateById()

Executes an updateById against the grid's underlying data-source.
Source: