views:

66

answers:

0

How can I bind selectable events after the selectable has already been initialized?

To start, I have:

$("#the-items").selectable({
    filter: "> tbody > .item"
});

Then I tried binding (.items are loaded dynamically):

$("#the-items").bind("unselecting", function(){ alert("!"); });    
$(".item").live("unselecting", function(){ alert("!"); });
$(window).bind("unselecting", function(){ alert("!"); });

... and similar variations. I guess I'm confused what I'm supposed to be binding to... the selectees or the selectable? Anyway, none of those work.

If I define the events in the init, they work fine.