Open amhoho opened 7 years ago
Translated from https://github.com/johnny/jquery-sortable/issues/213
isValidTarget: function ($item, container){
var depth = 1;
var maxDepth = 2;
var children = $item.find('ol').first().find('li');
//Add the amount of parents to the depth
depth += container.el.parents('ol').length;
//Increment the depth for each time a child
while (children.length) {
depth++;
children = children.find('ol').first().find('li');
}
return depth <= maxDepth
},
For example, there are three ul, each UL can only have 10 li. If you drag onto the maximum number of regions, it will be fail and trigger function nextpage();
What should I do to achieve this effect? Thank you!