2
我使用nestedSortable和一段時間,它工作正常,但約1分鐘後使用它打破並不返回整個列表,但只有一部分。 即時通訊使用toArray返回數據返回到PHP腳本,然後填充MySQL,但如果返回的JSON值不是整個列表更新混淆了數據庫。nestedSortable toArray不返回整個集合
有人有這種奇怪的行爲的麻煩,或者我做錯了什麼?
$('#load').click(function(){
$.get("get_tags.php", function(data){
$("#data").html(data);
$('ol.sortable').nestedSortable({
disableNesting: 'no-nest',
forcePlaceholderSize: true,
handle: 'div',
helper: 'clone',
items: 'li',
maxLevels: 3,
opacity: .6,
placeholder: 'placeholder',
errorClass: 'error',
revert: 250,
tabSize: 25,
tolerance: 'pointer',
toleranceElement: '> div',
update: function() {
list = $(this).nestedSortable('toArray');
$("#result2").html(JSON.stringify(list));
$.post('x.php', { update_sql: 'ok', list: JSON.stringify(list) },
function(data){
$("#result").html(data);
},
"html")
}
});
});
});
最近一次更新到插件是在2011年5月11日http://mjsarfatti.com/sandbox/nestedSortable/ – NccWarp9 2012-01-17 19:46:09
您是否嘗試過在js函數中使用'relocate'事件而不是'update'? – DOZ 2015-08-06 12:50:01