var menu = $("ol.menu").nestedSortable({
handle: '.move',
items: 'li',
placeholder: 'placeholder',
opacity: 0.7,
toleranceElement: '> i',
connectWith: 'ol',
isTree: true,
}).disableSelection();
$('#addMenu').on('click',function(){
var text = $('#menuText').val();
var link = encodeURIComponent($('#menuLink').val());
if(text != '' && link !=''){
var html = $('<li id="menu_'+(parseInt(menu.children.length)+2)+'" class="mjs-nestedSortable-leaf">')
.append($('<i class="glyphicon glyphicon-move">'),
' '+text+' - '+link,
$('<span class="remove-btn removeMenu">')
.append('<i class="glyphicon glyphicon-minus">'),
$('<ol>')
);
menu.append($(html));
menu.nestedSortable('refresh');
console.log(menu.nestedSortable('toArray'));
$('#menuText').val('');$('#menuLink').val('');
}else{
alert('Menü Başlığı ve link boş bırakılamaz!');
}
});
我已经红色,无论我能找到。但没有任何变化。我将新项目添加到列表中,但我无法将其移动到可排序容器中。页面加载的元素很好,它们是可移动的。如何做到这一点。nestedSortable新添加的项目不会移动
我冲这 - >nestedsortable dynamic item not collapsing
我无法事件使FUNC “nextid”,它的工作原理....
我所missig。
Thansk
没有工作。:/ – freezer 2014-09-21 18:51:07
不把函数放到document.ready! – amir2h 2014-09-21 19:06:40
我已经没有'我使用纯JQuery可排序插件,它工作正常,但我需要一些嵌套可排序的东西。 – freezer 2014-09-21 19:25:33