Sails.Js - How I do pagination in sails.Js

sasitha999

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?

Martin Malinda

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related