- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2024 07:42 AM
in UI Builder, i have a page where i have a grid of checkboxes, the columns are statis, but the rows are dynamically generated via a repeater with a local data source.
Does anyone know if it's possible to change the checkboxes states via client script code?
I dont think i can use states since states cant be created dynamically.
The idea is that outside of the repeater i have a header row of checkboxes, if you put a checkbox into one of the header columns, all checkboxes in that column would be checked automatically.
Is it possible to use scripting to se values on the form?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 03:10 AM
So i looked into this and i cant see that this is possible (at least normally) instead I found the best way to handle this, was to make sure each checkbox had a checked event mapping on them. Then when the checkbox was checked i would add information like name, value and other required information to a state a made called checkboxHandler, and if the checkbox was unchecked (event payload value was false) then i looked up the data in my checkboxHandler state and if a value was found, i removed it from the array.
This was perfect for each individual checkbox, but i also had header checkboxes for each category, and then i also had a main header checkbox for each column.
Here it was the same concept, i just had to iterate through each row and set the value in the checkboxHandler array or remove them, depending on the payload value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 03:10 AM
So i looked into this and i cant see that this is possible (at least normally) instead I found the best way to handle this, was to make sure each checkbox had a checked event mapping on them. Then when the checkbox was checked i would add information like name, value and other required information to a state a made called checkboxHandler, and if the checkbox was unchecked (event payload value was false) then i looked up the data in my checkboxHandler state and if a value was found, i removed it from the array.
This was perfect for each individual checkbox, but i also had header checkboxes for each category, and then i also had a main header checkbox for each column.
Here it was the same concept, i just had to iterate through each row and set the value in the checkboxHandler array or remove them, depending on the payload value.