Presently, I am in the process of customizing a multiple selection drop-down list using the features of the Multiple Selection Plugin. Here are the behaviors that I plan to implement for my customized selection:
- If the parent is selected, all children will be selected.
- If all children are selected, the parent will also be selected; if one child is deselected, then the parent will be deselected as well.
- When all children are selected, only the parent's name should appear in the selected field.
- The sub level should function like the 1st level too.
I have successfully accomplished (1), (2), and (4). However, I am still searching for a solution for (3).
Here is a sample JSON string representing the multi-selection:
var _str = '{"10":{"0":"0","1":"DISPONIBILITES","2":"t","style":"font-weight: bold;"},"16":{"0":"0","1":"TRESORERIE NETTE","2":"t","style":"font-weight: bold;"},...."}}}';
You can view the example I created at https://jsfiddle.net/skL589uu/7/.
Any insights or ideas on achieving behavior (3) would be greatly appreciated. Thanks!