Control the selected state of a checkbox in a list view using a "Select All" checkbox

Hello, Here is my solution.
first defined a variable named variable1,
then bind it to the checkbox in the listview as default value.
When check selectall checkbox, set variable1 value to true
when uncheck selectall checkbox, set variable1 value to false.

in the add product button's disable property using js(lodash) to find if there is at least one was checked. if all uncheck, disable the button.
Here is git screen shot for your reference.

Animation

2 Likes