jquery-sortable-lists
jquery-sortable-lists copied to clipboard
How to prevent child node to dragged in another parent node ... How to save Data to mysql and PHP
Thank you
In documentation first example there is C parant block, which does not allow insert item from another blocks. The code is related to isAllowed callback. There is also an examle code for this example:
var options = {
isAllowed: function(currEl, hint, target)
{
if( hint.parents('li').first().data('module') === 'c' && currEl.data('module') !== 'c' )
{
hint.css('background-color', '#ff9999');
return false;
}
else
{
hint.css('background-color', '#99ff99');
return true;
}
}
}
In another words every parent and his children has data-module attribute which identifies groups of items and you will check if hint parent has data-module compatible with dragged element.
To export list to structures which should be send to server there are three functions: sortableListsToArrayy(),sortableListsToHerarchy(), sortableListsToString(). This is the way to store it to database.