Class Index | File Index

Classes


Class links.DataTable


Defined in: treegrid.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
links.DataTable(data, options)
Method Summary
Method Attributes Method Name and Description
 
appendItems(items, callback, errback)
Asynchronously append a number of items.
 
getChanges(index, num, items, callback, errback)
Asynchronously check for changes for a number of items.
 
Returns the current filtering array, returns undefined if there is no sorting defined.
 
getItems(index, num, callback, errback)
Asynchronously get a number of items by index
 
Returns the current sorting array, returns undefined if there is no sorting defined.
 
insertItemsBefore(items, beforeItem, callback, errback)
Asynchronously insert a number of items.
 
moveItems(items, beforeItem, callback, errback)
Asynchronously move a number of items.
 
onEvent(event, params)
onEvent handler.
 
removeItems(items, callback, errback)
Asynchronously remove a number of items.
 
setFiltering(filters)
Set a filter for this DataTable
 
setSorting(filters)
Set sorting for this DataTable.
 
Force the DataTable to be changed by incrementing the update sequence
 
updateItems(items, callback, errback)
Asynchronously update a number of items.
Class Detail
links.DataTable(data, options)
Parameters:
{Array} data
A javascript array containing objects
{Object} options
Method Detail
appendItems(items, callback, errback)
Asynchronously append a number of items. The callback returns the appended items, which may be newly instantiated objects .
Parameters:
{Object[]} items
A list with items to be added
{function} callback
Callback method called on success. Called with one object as parameter, containing fields: {Number} totalItems {Array with Objects} items The appended items
{function} errback
Callback method called on failure. Called with an error message as parameter.

getChanges(index, num, items, callback, errback)
Asynchronously check for changes for a number of items. The method will return the items which are changed. The changed items can be updated via the method getItems.
Parameters:
{Number} index
Index of the first item to be checked
{Number} num
Number of items to be checked
{Object[]} items
A list with items to be checked for changes.
{function} callback
Callback method called on success. Called with one object as parameter, containing fields: {Number} totalItems {Array with Objects} items The changed items
{function} errback
Callback method called on failure. Called with an error message as parameter.

{Object[] | undefined} getFiltering()
Returns the current filtering array, returns undefined if there is no sorting defined.
Returns:
{Object[] | undefined}

getItems(index, num, callback, errback)
Asynchronously get a number of items by index
Parameters:
{Number} index
Index of the first item to be retrieved
{Number} num
Number of items to be retrieved
{function} callback
Callback method called on success. Called with one object as parameter, containing fields: {Number} totalItems {Array with Objects} items
{function} errback
Callback method called on failure. Called with an error message as parameter.

{Array.<{field: string|order: string}> | undefined} getSorting()
Returns the current sorting array, returns undefined if there is no sorting defined.
Returns:
{Array.<{field: string|order: string}> | undefined}

insertItemsBefore(items, beforeItem, callback, errback)
Asynchronously insert a number of items. The callback returns the inserted items, which may be newly instantiated objects .
Parameters:
{Object[]} items
A list with items to be inserted
{Object} beforeItem Optional
The items will be inserted before this item. When beforeItem is undefined, the items will be moved to the end of the data.
{function} callback
Callback method called on success. Called with one object as parameter, containing fields: {Number} totalItems {Array with Objects} items The inserted items
{function} errback
Callback method called on failure. Called with an error message as parameter.

moveItems(items, beforeItem, callback, errback)
Asynchronously move a number of items. The callback returns the moved items, which may be newly instantiated objects .
Parameters:
{Object[]} items
A list with items to be moved
{Object} beforeItem Optional
The items will be inserted before this item. When beforeItem is undefined, the items will be moved to the end of the data.
{function} callback
Callback method called on success. Called with one object as parameter, containing fields: {Number} totalItems {Array with Objects} items The moved items
{function} errback
Callback method called on failure. Called with an error message as parameter.

onEvent(event, params)
onEvent handler. Can be overwritten by an implementation
Parameters:
{String} event
{Object} params

removeItems(items, callback, errback)
Asynchronously remove a number of items. The callback returns the removed items.
Parameters:
{Object[]} items
A list with items to be removed
{function} callback
Callback method called on success. Called with one object as parameter, containing fields: {Number} totalItems {Array with Objects} items The removed items
{function} errback
Callback method called on failure. Called with an error message as parameter.

setFiltering(filters)
Set a filter for this DataTable
Parameters:
{Object[]} filters
An array containing filter objects. a filter object can contain parameters `field`, `value`, `startValue`, `endValue`, `values`.

setSorting(filters)
Set sorting for this DataTable. Can sort one or multiple columns
Parameters:
{Array.<{field: string|order: string}>} filters
An array containing sorting objects. a sorting object contains parameters `field`, `order`. Order can be `asc`, `desc`, or null.

update()
Force the DataTable to be changed by incrementing the update sequence

updateItems(items, callback, errback)
Asynchronously update a number of items. The callback returns the updated items, which may be newly instantiated objects .
Parameters:
{Object[]} items
A list with items to be updated
{function} callback
Callback method called on success. Called with one object as parameter, containing fields: {Number} totalItems {Array with Objects} items The updated items
{function} errback
Callback method called on failure. Called with an error message as parameter.

Documentation generated by JsDoc Toolkit 2.3.2 on Fri Nov 20 2015 11:10:07 GMT+0100 (CET)