jquery-nestable

Provide onclick dynamically and avoid duplicate event calling

余生颓废 提交于 2021-01-28 19:11:38
问题 I try to add an item, just like this sample: https://codepen.io/Gobi_Ilai/pen/LLQdqJ var addToMenu = function () { var newName = $("#addInputName").val(); var newSlug = $("#addInputSlug").val(); var newId = 'new-' + newIdCount; nestableList.append( '<li class="dd-item" ' + 'data-id="' + newId + '" ' + 'data-name="' + newName + '" ' + 'data-slug="' + newSlug + '" ' + 'data-new="1" ' + 'data-deleted="0">' + '<div class="dd-handle">' + newName + '</div> ' + '<span class="button-delete btn btn

Nestable2- How to prevent child node to dragged in another parent node?

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-10 07:00:07
问题 Hello, I have used nestable2, I want to prevent child node not to dragged in another parent node. It should be dragged in its parent node only. I have used this method of nestable2 to get source and destination. I want to put validation that child node should not dragged to another parent. it should dragged in its parent. I have applied below method, but it is not giving me destinationtype, Please suggest help $('#nestable').nestable({ beforeDragStop: function(l,e, p){ // l is the main

Nestable2- How to prevent child node to dragged in another parent node?

ぃ、小莉子 提交于 2020-07-10 07:00:01
问题 Hello, I have used nestable2, I want to prevent child node not to dragged in another parent node. It should be dragged in its parent node only. I have used this method of nestable2 to get source and destination. I want to put validation that child node should not dragged to another parent. it should dragged in its parent. I have applied below method, but it is not giving me destinationtype, Please suggest help $('#nestable').nestable({ beforeDragStop: function(l,e, p){ // l is the main

How to move list-items between same depth for nestable list

我怕爱的太早我们不能终老 提交于 2019-12-02 18:56:36
问题 I am using https://github.com/RamonSmit/Nestable for drag n drop list items within the ordered-list. I have taken js and css from:- https://cdnjs.cloudflare.com/ajax/libs/nestable2/1.5.0/jquery.nestable.css https://cdnjs.cloudflare.com/ajax/libs/nestable2/1.5.0/jquery.nestable.js Following is the ordered list that I have created:- <div class="dd"> <ol class="dd-list"> <li class="dd-item" data-id="1" data-type="Chapter"> <div class="dd-handle">Item 1</div> </li> <li class="dd-item" data-id="2"

How to move list-items between same depth for nestable list

倖福魔咒の 提交于 2019-12-02 09:28:02
I am using https://github.com/RamonSmit/Nestable for drag n drop list items within the ordered-list. I have taken js and css from:- https://cdnjs.cloudflare.com/ajax/libs/nestable2/1.5.0/jquery.nestable.css https://cdnjs.cloudflare.com/ajax/libs/nestable2/1.5.0/jquery.nestable.js Following is the ordered list that I have created:- <div class="dd"> <ol class="dd-list"> <li class="dd-item" data-id="1" data-type="Chapter"> <div class="dd-handle">Item 1</div> </li> <li class="dd-item" data-id="2" data-type="Chapter"> <div class="dd-handle">Item 2</div> </li> <li class="dd-item" data-id="3"data

Nestable jQuery plugin - disable dragging between lists

假装没事ソ 提交于 2019-12-02 01:45:42
问题 I would like to disable dragging between two lists in jQuery nestable plugin. There is an option group in documentation https://github.com/RamonSmit/Nestable group group ID to allow dragging between lists (default 0) So I change that to element id $('.dd').nestable({ maxDepth: 1, group: $(this).attr('id') }); But it's not working. User can drag and drop items between two nestables as he wants. 回答1: In your current code, this refers to the parent scope, somethings like window or document , not

Nestable jQuery plugin - disable dragging between lists

非 Y 不嫁゛ 提交于 2019-12-01 23:50:23
I would like to disable dragging between two lists in jQuery nestable plugin. There is an option group in documentation https://github.com/RamonSmit/Nestable group group ID to allow dragging between lists (default 0) So I change that to element id $('.dd').nestable({ maxDepth: 1, group: $(this).attr('id') }); But it's not working. User can drag and drop items between two nestables as he wants. In your current code, this refers to the parent scope, somethings like window or document , not .dd . You have to call nestable for each list, try this: $('.dd').each(function(){ $(this).nestable({