You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an au-table that displays rows, the user can page through the data and click a button which navigates to a view to display the selected row's details. When the user goes back to the master list view I need to be able to open the table on the page the user was on when they viewed the details.
I've bound currentPage which is held in a singleton to preserve the value, however when the user navigates back to the master list the data is reloaded and the currentPage is reset to 1 (by au-table).
Is there a way I can get the table to render the current page without it being reset to 1?
Thanks
Matt
The text was updated successfully, but these errors were encountered:
Hello, I can see your problem. I think the easiest way to do it is to have a way to force a specific page on the table.
The page is being reset because filter changes, data size changes, sort changes affect pagination, so the easiest approach is just to reset the current page to 1 whenever any of those happen.
Something you can do right now is to give Aurelia Table a chance to initialize itself, then set the current page to whatever you need it to be. If you set the current page after the data is set you should be good, but just to be sure you can delay the setting of the current page a little bit.
If this approach is not working, we can expose a method on aurelia table to set the current page.
Thanks for response - I did try and place the currentPage update in the various aurelia view lifecycle events but that didn't set the page correctly. Putting a promise based sleep for a tenth of a second after the data fetch resolved did work but it's not ideal. A method to set the currentPage would be perfect.
Was there any work on creating a method to set the currentPage. I've got it working using a window.setTimeout with 100ms delay but it causes a slight flicker in the table. If we could set currentPage to something like [myCurrentPage] instead of back to '1' and we could also bind to myCurrentPage that should solve the flicker right.
Hello
I have an au-table that displays rows, the user can page through the data and click a button which navigates to a view to display the selected row's details. When the user goes back to the master list view I need to be able to open the table on the page the user was on when they viewed the details.
I've bound currentPage which is held in a singleton to preserve the value, however when the user navigates back to the master list the data is reloaded and the currentPage is reset to 1 (by au-table).
Is there a way I can get the table to render the current page without it being reset to 1?
Thanks
Matt
The text was updated successfully, but these errors were encountered: