Possible Duplicate:
How to programmatically select selectables with jQuery UI?
Does anyone know how to manually or programmatically select a child item of a jQuery UI selectable?
Possible Duplicate:
How to programmatically select selectables with jQuery UI?
Does anyone know how to manually or programmatically select a child item of a jQuery UI selectable?
This isn't exclusive to a selectable object, but if you just want to get the html node, you can use the :nth-child()
selector found here.
$(".selector li:nth-child(2)")
Depending on what you need to do with this child, this may work for you.
EDIT
I think I missed your intended meaning of 'select'. I don't immediately see an easy way to use the API to select an item, but you could always just add the class ui-selected
to a child item and the css should take care of the rest. This probably won't trigger API events, however.
Or, you could just do
$(".selector li:nth-child(2)").click();
to select with a fake mouse click.
From my answer to this question...
function SelectSelectableElements (selectableContainer, elementsToSelect)
{
// add unselecting class to all elements in the styleboard canvas except the ones to select
$(".ui-selected", selectableContainer).not(elementsToSelect).removeClass("ui-selected").addClass("ui-unselecting");
// add ui-selecting class to the elements to select
$(elementsToSelect).not(".ui-selected").addClass("ui-selecting");
// trigger the mouse stop event (this will select all .ui-selecting elements, and deselect all .ui-unselecting elements)
selectableContainer.data("selectable")._mouseStop(null);
}