Frage

I'm using jQuery UI MultiSelect Widget I'm using 5 of them in one page What I'm looking for is to programmatically select couple of of check boxes in each of the MultiSelect widget I found the following code after a fair amount of research

$("select").multiselect("widget").find(":checkbox[value='value']").each(function() {
    this.click();
});

this one works but only works for the first widget How could I do this for the other widgets as well Looking forward to some replies that would help me to progress

thanks in advance

War es hilfreich?

Lösung

I found the answer myself I would like to close it but the solution was quite simple

changing Select to the id of the select will give the user the ability to get any particular multiselct widget.Like the snippet below

$("#idOfSelect").multiselect("widget").find(":checkbox[value='bing']").each(function()          {
    this.click();
});

Andere Tipps

There is no native method called .multiselect in jQuery. This is a custom method created by the widget author.

I'm assuming this is your widget, with some basic how-to's: jQuery UI Multiselect

Linked from that page is a demo page showing multiple groups of select options. The author explains how to bind the events/methods to the groups. Look there first and then come back if you have problems.

jQuery UI Multiselect Demo Page

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top