CheckBoxes stay checked/unchecked in paginated table on severconnect load

Wappler Version: 5.3.1
Operating System: Windows/Linux
Server Model: NodeJS
Database Type: PostgresSQL
Hosting Type: Docker

Expected behavior

What do you think should happen?
Am Using toggles(css)/checkboxes for change of status, which on success does a serverconnect load to refresh the table data.
The issue is after the change of status ie toggle enable/disable Checkbox should dynamically change when moving across the pagination offsets.

Actual behavior

What actually happens?
The same boxes stay ticked or unticked when page offsets change, and require a page refresh.

How to reproduce

  • Create a Paginated table having a status column
  • Create an API for the status update,
  • On UI, Add a Checkbox in the cell for status
  • Add the dynamic click action on click of checkbox for the status column cell: sc_status_update.load({status: status==true ? false : true, id: id})
  • Change the status of any of the rows and then move to the next page offset, the same row will show the last action whether checked or unchecked, and this requires a refresh of the entire page to show the correct values

Just make sure to select an unique value for key option in the repeater.

Hi @Teodor , I tried that, but still facing same issue

.

Use a dynamic action for success of the status update server connect to reload the server connect that feeds the table repeat

Yes, am doing that, but after load, the checkbox stays checked/unchecked on the last action. Forgot to mention that am using a status filter aswell on the same page, so basically when i disable, the entry goes away from there, but the new entry thats shows up in its place also shows disabled, when in actual its enabled

Can you show the code of the repeat? It looks like the key might be ="'id'" using id as a string rather than ="id" which looks for the data binding

your right, it added it as a string rather than a binding. will try changing that.
<tbody is="dmx-repeat" dmx-generator="bs5table" dmx-bind:repeat="sc_get_list.data.query.data" id="tableRepeat2" dmx-state="qm_list" dmx-sort="sort" dmx-order="dir" key="'id'">

Thanks @bpj, that worked!!! :grinning:

1 Like

When choosing the key, use the lightning bolt to select the binding rather than just typing the name in

2 Likes