Replies: 2 comments
-
Hmm, that is weird. If the code is almost the same I'm not sure what is going on here, but a few places I would dig around:
If you have a repo with some example code that reproduces this, I can take a look! |
Beta Was this translation helpful? Give feedback.
-
In the javascript console I see "Unchecked runtime.lastError: The message port closed before a response was received." at "www.django-unicorn.com/:1", but I think that's innocuous. No Python errors.
![]()
Yeah, this is what led me to believe something is wrong or I have a fundamental misunderstanding of how this is supposed to work. I left the prints in so you can see.
https://github.com/cro/unicornx You should be able to clone that, setup a venv, use Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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