In jQuery UI, what is the type/contents of the "ui" object passed to the callback function of alot of the event methods, and how do I use it?
For example, the "selectable" demo, the event "selected" gets passed two params. "Event" and "UI". I am trying to use it as follows:
$("#selectable").selectable({
selected: function(event, ui) {
$(ui).find("input").attr('checked', true);
}
});
(here is the html:)
<ol id="selectable">
<li class="ui-state-default"><input type="checkbox" value="1" /></li>
<li class="ui-state-default"><input type="checkbox" value="2" /></li>
<li class="ui-state-default"><input type="checkbox" value="3" /></li>
<li class="ui-state-default"><input type="checkbox" value="4" /></li>
<li class="ui-state-default"><input type="checkbox" value="5" /></li>
<li class="ui-state-default"><input type="checkbox" value="6" /></li>
<li class="ui-state-default"><input type="checkbox" value="7" /></li>
<li class="ui-state-default"><input type="checkbox" value="8" /></li>
<li class="ui-state-default"><input type="checkbox" value="9" /></li>
<li class="ui-state-default"><input type="checkbox" value="10" /></li>
<li class="ui-state-default"><input type="checkbox" value="11" /></li>
<li class="ui-state-default"><input type="checkbox" value="12" /></li>
</ol>
But it isn't working. What am I doing wrong? I'm assuming that the ui param is set to an object representing the "li" that is selected, but when I try and use it it doesn't seem to be the case...