我也希望从服务器端删除一个项目,因此我需要id
项目转到trash div
,下面的方法在被放到trash div
时被调用。< / p>
drop: function(e, selected) {
var $current_container, $original_container, $previous_container;
if (_this.options.enableTrash) {
alert(original_container_class);
$original_container = $("." + original_container_class);
$current_container = $("." + current_container_class);
$previous_container = $("." + previous_container_class);
$selected = $(selected.helper);
$current_container.trigger("ss-trashed", $selected);
$selected.remove();
$original_container.trigger("ss-rearrange").removeClass(original_container_class);
$current_container.trigger("ss-rearrange").removeClass(current_container_class);
return $previous_container.trigger("ss-arrange").removeClass(previous_container_class);
}
}
FIDDLE: http://jsfiddle.net/LNysC/2244/
答案 0 :(得分:1)
试试这个
$('.trash').on('ss-trashed', function (e, selected) {
console.log($(selected).attr('id'))
})