Hello,
I have a question regarding the Table component, so I'm creating a new topic.
I've set one of the columns in the Table as a boolean type to always display a checkbox, and made it editable. When I click on a checkbox, the changes are captured in changesetArray
and changesetObject
. However, I would like to ensure that only the last clicked checkbox remains checked — meaning only one checkbox should be selected at any time.
Ideally, I want changesetArray
to contain only the most recent change, rather than accumulating multiple changes.
Also, I would still like the UI to indicate that a change has been made, just as it does now.
Is there a recommended way to implement this behavior?
Thank you, and I hope you have a great day!
If there's a way to reset the changesetArray
when a cell of a boolean-type column is clicked, and ensure that only the most recent change is included in the changesetArray
, that would be sufficient. Is there a way to achieve this?
Hi there @Jaemoon_Lee,
I had to think this one through.... but unfortunately I couldn't come up with a solution. There is no way of delaying the checkbox click, which could be a way of adding a clearChangeset before checkbox is added into the changesetArray.
As both changesetArray and changesetObject are ready only, there is anything we can't do to manipulate them.
Instead of a checkbox, you could add a dynamic button, something like:
- adding a new column with "button" as type
- add a new variable that can capture the index of the selected button, and the rest of the data if needed
- dynamically define both color and value based on whether the variable contains the index of that row, e.g. all buttons are red until one is clicked which then becomes green, and subsequently whenever another one is clicked only the one that is within the vriable will be green
- Use the data in the varaible for insert/edit query you may need to do.
2 Likes