Hi,
I was wondering if it would be possible to bring back the dmx.requestUpdate() function?
We are currently trying to update all the functionalities of our application and we keep running into problems where we used te use this function.
Because of this we aren't able to update our application to the newest wappler version and the longer we wait the further we fall behind.
We have (barely) been able to solve one of our problems in another post.
Right now I have a simular problem where I have a table of records with a checkbox infront of every row. And I have a second table where I need to show all records that are selected (checked).
I do this by refering to the first table and using a where formatter to filter all items where the checkbox is checked like so:
<div dmx-repeat:checked_items="first_repeat.where(`select_checkbox.checked`, true, '==')"></div>
This works great. Every time a checkbox is checked a new row appears and when it's unchecked it disappears.
But I also have a button where I want to check/uncheck all rows at the same time (check all even if some are unchecked and uncheck all when all are checked). I wrote a Javascript function where I change the checked state of the checkboxes like below:
function checkAll() {
//select all checkboxes with the same classname
let checkboxes = document.querySelectorAll('.select_checkbox');
//count all checkboxes that aren't checked
let count = [...checkboxes].filter(c => !c.checked).length;
//check/uncheck all checkboxes if count is greater than 0
checkboxes.forEach((c) => c.checked = count > 0);
//dmx.requestUpdate() -- deprecated!
}
When I click the button the checkboxes are checked/unchecked, but the second table does not update to show all the rows that are checked. Only if I click an individual checkbox it updated to the correct checked rows.
If I enable the dmx.requestUpdate() in the older versions it works as expected.
There are a few more funtions where we rely on this function and they all work a little different but the result is the same. Without dmx.requestUpdate() the state of the application is'nt updating correctly.
Is there a chance to bring this funtion back or are there better options available that I am not aware of?
Thanks for your time.