I want to create paginated table using sails.js, mongodb and waterline-ORM.
Is there a any specific way to do pagination in sails.js?
Waterline is a next-generation storage and retrieval engine, and the default ORM used in the Sails framework.
Sails. js uses Grunt as a build tool for building front-end assets. If you're building an app for the browser, you're in luck. Sails ships with Grunt — which means your entire front-end asset workflow is completely customizable, and comes with support for all of the great Grunt modules which are already out there.
js (or Sails) is a model–view–controller (MVC) web application framework developed atop the Node. js environment, released as free and open-source software under the MIT License. It is designed to make it easy to build custom, enterprise-grade Node. js web applications and APIs.
http://sailsjs.org/#/documentation/concepts/ORM/Querylanguage.html
Model.find().paginate({page: 2, limit: 10}); Model.find({ where: { name: 'foo' }, limit: 10, skip: 10 });
If you want the pagination to work asynchronously, its very easy to do with JQUERY $$.getJSON
and on the server res.json();
Theres a lot of info in waterline and sails docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With