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 动态项不折叠
我无法使 func "nextId" 起作用....
我是什么小姐。
坦斯克