sails-datatable
This module is a Waterline/Sails adapter to use with jQuery datatable (tested on 1.10.4). I implement only basic things.
Installation
To install this adapter, run:
$ npm install sails-datatable
Usage
This adapter exposes the following methods:
datatable(params)
- params variable is datatable params
Example of use
After you install follow these steps:
1.Open config/adapters.js
and put there:
'sails-datatable': ;
2.Open config/connections.js
and add:
datatable: adapter: 'sails-datatable'
3.Open model file and add connection:
connection: 'datatable'
4.In controller add datatable action (example below):
datatable: { Model; }
5.Populate in datatable:
datatable: { reqparamspopulate = 'item1' 'item2' 'item3'; Model; }
6.Filter in datatable:
datatable: { // Like where conditions in waterline reqparamsfilter = param1: 'value1' ; Model; }
License
MIT © 2014 lukaszpaczos
Sails is free and open-source under the MIT License.