Skip to content

Feature Request: Ability to Select/Unselect All/disable programatically for an opt group #231

@bigcmos

Description

@bigcmos
<select multiselect id="foo">
 <optgroup value="bar">BAZ</optgroup>
 <optgroup value="x">y</optgroup>
 <optgroup value="a">b</optgroup>
 </select>

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();
}
});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions