charlespockert / aurelia-bs-grid

Aurelia and Bootstrap powered datagrid control

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Paging

johntom opened this issue · comments

Hi Charles,
Things are looking better very time I get a chance to checkout the latest. It seems that your demo emulates server side paging. As a veteran of angular girds (ng-grid, ng-table, angular-grid and kendo-ui) all supporting client side paging, I'd like to know if this is something in the works.
TIA
John

Hi John,

The grid already supports server and client side paging and will also support something in between by the next release (which is sort of due yesterday!), which will be client-side paging with a call to read each time so you can perform your own paging logic.

The demo here shows the grid paging/sorting/filtering on the client side with no additional user code:

http://charlespockert.github.io/aurelia-bs-grid-demo/#/local

There's a slight issue with the server side paging etc in that the grid will call read if it doesn't need to but I'll fix this in next release.

Whatever you return in the promise from read.call becomes bound to the grid, be that server side data or a local collection

The grid takes a reference to the data and watches it using an observer, so you can actually mutate the data source without having to call refresh/etc on the grid and the grid will update.

http://charlespockert.github.io/aurelia-bs-grid-demo/#/mutation

Since the data is bound to your original array, you can also mutate the objects in the array and the grid will also update

The paging/sort/filter works client side unless server-paging.bind="true" or one of the other respective attributes

Is there any particular functionality you are missing?

Ah I might add that for server side paging you need to take the grid options data and pass it to your API to allow your server to know what page/size it needs to retrieve:

https://github.com/CharlesPockert/aurelia-bs-grid-demo/blob/master/src/remote-data.js#L14

Hi,
So i missed changing the setting server-paging.bind="false". Works great!
John

No probs - I'll be updating the docs again with any API additions, let me know if you think anything needs clarification