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'm having some trouble with a pagination component and the behavior is unusual enough that I'm wondering if I'm looking at some kind of bug in django-unicorn.
I have a set of nested components where the parent component retrieves a subset of the list from the database. One child component is for filtering and next/prev page buttons. A second child component displays the the subset of the list. I keep the current displayed page in the parent component. The next button increments the current page and calls a load_table function to update the contents, the prev button does the same but decrements. The confusion is that the next button always works, but the prev button only works once. After that the current page seems to be "stuck".
Part of the debugging journey made me realize one of my assumptions was totally wrong--I thought that there was some state being kept on the server side. In fact, all the state is being kept in the page and serialized/deserialized on the server for each request. After pondering this it makes sense to me, please correct me if I'm wrong.
I'm at a loss to explain the differing behavior between the next and prev buttons. The code for those functions is literally identical except for guard checks and the page=page+1/page=page-1 lines. What would you need to help me debug this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm having some trouble with a pagination component and the behavior is unusual enough that I'm wondering if I'm looking at some kind of bug in django-unicorn.
I have a set of nested components where the parent component retrieves a subset of the list from the database. One child component is for filtering and next/prev page buttons. A second child component displays the the subset of the list. I keep the current displayed page in the parent component. The next button increments the current page and calls a
load_table
function to update the contents, the prev button does the same but decrements. The confusion is that the next button always works, but the prev button only works once. After that the current page seems to be "stuck".Part of the debugging journey made me realize one of my assumptions was totally wrong--I thought that there was some state being kept on the server side. In fact, all the state is being kept in the page and serialized/deserialized on the server for each request. After pondering this it makes sense to me, please correct me if I'm wrong.
I'm at a loss to explain the differing behavior between the next and prev buttons. The code for those functions is literally identical except for guard checks and the
page=page+1
/page=page-1
lines. What would you need to help me debug this?Beta Was this translation helpful? Give feedback.
All reactions