Data loading techniques – Pagination

Andrew
about 1 year agoMay 28, 2018
I like the data down, actions up on the query parameters but that seems to break the back button. How do you deal with that?
Balint Erdi
about 1 year agoMay 28, 2018
30:44:55
The URL changes when the DDAU-enabled Next link is clicked (see the time of the video linked from this comment, so it should work the same as the `refreshModel`-enabled QP solution. Doesn't it?
Andrew
about 1 year agoMay 29, 2018
I don’t know about your site but I implemented that design into my app and if I click to change params it works fine, when I use the back button, the params change in the URL but nothing changes in my app.
Balint Erdi
about 1 year agoMay 29, 2018
In this case, I'm almost certain you didn't specify `refreshModel: true` for the query parameter in question: https://guides.emberjs.com/release/routing/query-params/#toc_opting-into-a-full-transition
Andrew
about 1 year agoMay 30, 2018
30:24:14
I agree, but that’s exactly what you did at 30:24, you removed that to allow the DDAU. My point was that seems to break the route handling the back button with parameters. So DDAU with query parameters may not be such a good idea. Specifying query params on both the controller and the route seem necessary.
Balint Erdi
about 1 year agoMay 31, 2018
I took a better look and you're absolutely right, the Back button is broken when not using `refreshModel: true`. Since there are scenarios where refreshing the model hook manually is needed (for example, when a new search is issued: first reset page number to 1, and then rerun the model hooks)I want to make the DDAU-route compatible with the Back button.

I started to dig deeper but haven't yet found a solution I'm content with. You'll hear from me but when I do but in the meantime, if you have any insights, do share them :)
Your comment