Open ddresch opened 8 years ago
I think it's necessary to go back to page 1 when the filter changes - filtering makes the table smaller, and you wouldn't want to end up on a page that was past the rows you were on or even past the end of the table.
You could use the session to store more page number history, instead of only mirroring the current page of the table, if you want to be able to go back farther.
Thanks a lot for your quick response!!!
Don't you think it makes sense to store the item count internally and check if it changed when setting currentPage again? Like this it's more easy to handle when using the component.
I'm not sure all applications would want this to work the same way, so I'd rather make it possible to add on externally than have configuration options and more complicated code in the package.
Hmm ok but to handle this properly outside of the component, we'll need a kind of external API to access e.g. pageCount etc.
To call e.g. this method: https://github.com/aslagle/reactive-table/blob/master/lib/reactive_table.js#L333
A bit like autoform is doing it with an global id per form / table.
ReactiveTable.getPageCount(tableId);
What you think?
An external API is a great idea but I don't have time to do it. I'd probably prefer something more along the lines of creating a ReactiveTable object you can call methods on and also pass in to the template, rather than relying on global ids.
I'm using a
settings
object like this:Nothing special, the problem are the filters which force the list to jump back to page 1, per default.
How is it possible to "remember" the currentPage position without
reactive-table
overriding to 0?The Session handling of simple lists without filters is going right, the moment you use filters it behaves like this.
I mean it's a common use case - filter a list then edit an item going back to list.