c12*_*c12 8 jquery jquery-ui jquery-ui-sortable
我正在使用jquery ui来处理您可以在其中排序的列表,然后在另一个列表之间进行排序.我正在使用更新进行排序,并且工作正常.当我在中间排序时,我只想调用接收函数而不是更新.目前,更新被调用,然后接收被调用.在列表之间进行排序时,有没有办法跳过更新调用?
<script>
$ = jQuery
$(function() {
$( "#sortable1).sortable({
connectWith: ".connectedSortable",
placeholder: "ui-state-highlight",
update: function(event, ui) {processSortWithin(ui.item.attr("id"), ui.item.index()); },
receive: function(event, ui){
processSortBetween(ui.item.attr("id"), ui.item.index(),ui.sender.attr("id"));
}
}).disableSelection();
});
</script>
Run Code Online (Sandbox Code Playgroud)
Ste*_*fan 13
答案来自:http://forum.jquery.com/topic/sortables-update-callback-and-connectwith
update: function(e,ui) {
if (this === ui.item.parent()[0]) {
//your code here
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6523 次 |
| 最近记录: |