Convert client pagination to serverside pagination

37 views
Skip to first unread message

n.so...@gmail.com

unread,
Jul 6, 2014, 9:39:15 AM7/6/14
to knock...@googlegroups.com
Hi, I have the following model that allows me client pagination, how can I modify it so that every page is loaded server side?
Here there's my client viewmodel: http://jsfiddle.net/sonnicolo/DbFs3/

Thank you!


Bart Breen

unread,
Jul 7, 2014, 7:17:58 AM7/7/14
to knock...@googlegroups.com, n.so...@gmail.com
you would need to send the view model object (or at least the important information, such as page number, number of results) to the server and that would have to handle it.
In my app i return a generic paged result object, which contains stuff like the current page number, total number of pages, total number of results, etc.
i generally just send the page number and paging size, and let the server handle the rest, but that doesn't allow you to do ordering by column like you have in your view model.

n.so...@gmail.com

unread,
Jul 7, 2014, 8:47:24 AM7/7/14
to knock...@googlegroups.com, n.so...@gmail.com
Thank you for your response. My problem is that I do not know how to update the data model with the new page request to the server. 
Using an asynchronous call, what should I write in the event "success" to update data? Can you write a little piece of code as you write?
Reply all
Reply to author
Forward
0 new messages