I have table with server-side pagination enabled. This table has a "Row Select Change" event trigger where it updates the value of a temporary state.
Let say the user selected 2nd row of this table. Everything works as expected. However, if the user just goes to next page without doing anything else, 2nd row of 2nd page is selected automatically (it is highlighted), but "Row Select Change" event doesn't trigger, even though the selected row is effectively a different row now.
I've tried adding a handler to "Page Change" event, but when I try to access the selected row of the table in the handler, it is the old row, not the selected tow after page change.
Any help is appreciated.
Hi @randomVariable, looks our someone from our team was able to help you out. In case you haven't viewed it, here was his response:
I was able to get the temp state variable to update based on the row selected, even when the same row is selected on the next page, by using a success event handler on the query you use to get your data initially (users query in backend folder in your case).
You can use your exact same script from your table event handler(Row Selected Change) in your success event handler for your "users" query! If you keep both of these handlers then when you have a row selected and you switch pages your "users" query runs and the temp state gets updated. Likewise since you have the other event handler on your table, when you click on another row your temp state gets updated. I created a short video demo for you to see if this is a possible solution for your use case. You can check out the video here. Here is also an attached demo of the app for you to import and try out.