Friday, 24 June 2011

How to call the methods of the jQuery UI Multiselect Widget

I'm working with the really cool jQuery UI Multiselect Widget by Eric Hynds.

My jQuery knowledge is currently still building and i was trying to find a clear cut example on how to call the methods of the Widget, such as 'refresh', 'checkall' and 'uncheckAll'.

I tried many Incorrect Syntaxes:


$("#MyMultiSelectElementID").multiselect.uncheckAll();


$("#MyMultiSelectElementID").multiselect().uncheckAll();

$("#MyMultiSelectElementID").multiselect({"uncheckAll})

The Correct Syntax is:

$("#MyMultiSelectElementID").multiselect("uncheckAll");

But i'm still unsure as to how you call a method that takes parameters, eg _toggledDisabled.

This does not seem to work: 

$("#MyMultiSelectElementID").multiselect("_toggleDisabled(true)");

No comments:

Post a Comment