In this article, I want to discuss one of the repeating issues in the community, how to implement a cascading checkbox with a gallery. The checkboxes should get create automatically and must drive from a datasource.
Business Case: User want to implement cascading checkbox driving from data source. It should hold the previous selections and deselect the child checkboxes when we deselect the parent checkbox.
Users are not able to retain the previously selected check boxes as part of the chield gallery control when when the select new parent item.
I have created couple of collections in my solution and added all the checked and selected chield controls in those collection rendered in the gallery with check boxes.
I have used toggle controls to ensure the code is reused because I noticed I need to use checkbox onCheck and unCheck property I need to use the same code.