wenzhixin / multiple-select

A jQuery plugin to select multiple elements with checkboxes :)
http://multiple-select.wenzhixin.net.cn
MIT License
1.91k stars 651 forks source link

Any way to only select/send the parent optgroup value, when all children are selected? #448

Closed noc2spam closed 5 years ago

noc2spam commented 5 years ago

Actually, our setup has many records as the children. It would have been awesome, if the plugin only sent the parent optgroup value, instead of sending the value of all children; in case everything in that optgroup is selected. Any easy way to do this using the existing API?

Sorry if the description doesn't make sense. Here's a screenshot of what I am trying to achieve:

https://i.imgur.com/T0BeOlu.png

wenzhixin commented 5 years ago
$('select').multipleSelect('getSelects', 'text')

http://multiple-select-live.wenzhixin.net.cn/code/wenzhixin/493

noc2spam commented 5 years ago

Ahh, thanks a bunch man! Yupp that will work. :)