编辑:
jQuery UI 可选小部件内置了一个回调stop
,我需要知道如何以编程方式触发此事件。
(这措辞不好)
我已将事件侦听器附加到 jQuery UI Selectable Widget。如何以编程方式触发stop
事件?
防爆可选:
$("table").selectable({
filter: "tr",
stop: function(){
//do stuff
}
});
// Various attempts at triggering the stop event
// one
$("table .ui-selected").click();
// two
$("table .ui-selected").select();
// three
$("table .ui-selected").trigger("click");
// shot in the dark 1
$("table").selectable('widget').trigger('stop');
// Shot in the dark 2
$("table").trigger('stop');
// really long shot in the dark
$("table").selectable('widget').call('stop');
进一步的尝试
// selectablestop event
$("#table").selectable('widget').trigger('selectablestop');
$("#table .ui-selected").trigger('selectablestop');