ehynds/jquery-ui-multiselect-widget — Issue #231: Feature Request: Ability to Select/Unselect All/disable programatically for an opt group
Author: bigcmos
Created: 2012-03-02 19:48:58+00:00
State: open

BAZ
y
b

What I want to write is something like this:

$('#foo').multiselect('checkAll', {optgroupNum=0}); // checks all options under "BAZ"

Nice to have:

$('#foo').multiselect('uncheckAll', {optgroupValue="x"}); // unchecks all options under "y"
$('#foo').multiselect('disable', {optgroupText="b"}); // checks all options under "b"

Code I currently have to write:

$($('#foo').multiselect('widget').find('li.ui-multiselect-optgroup-label')[0]).nextUntil('.ui-multiselect-optgroup-label').find(':checkbox').each(function(i, e) {
if ($(this).attr('aria-selected')) {
this.click();
}
});