I'm using jsTree for the first time and everything is going well, the dnd plugin works fine except for dragging nodes to the root level.
After searching for a solution, I only find answers for how to NOT drop a node on the root level.
Dropping nodes (even root nodes) into a parent node is no problem. But I can't drop a node at root level, although with check_callback : true, there should be no problem.
Beneath I'll paste the config of the tree.
Does anyone have an idea what could be wrong?
'core' : {
'data' : {
'url' : '/management/categories/load',
'data' : {'objectContext' : objectContext},
'dataType': 'json'
},
'check_callback' : true,
'multiple' : false,
'themes' : {
dots : false,
variant : 'large'
}
},
'plugins' : ['dnd', 'state', 'wholerow', 'types', 'crrm', 'sort'],
'types' : {
'default' : {
'icon' : 'fa fa-folder'
},
'folder-open' : {
'icon' : 'fa fa-folder-open'
},
'folder-close' : {
'icon' : 'fa fa-folder'
}
},
'dnd' : {
'large_drag_target' : true,
'large_drop_target' : true
},
'sort' : function(a, b) {
return this.get_node(a).original.position > this.get_node(b).original.position ? 1 : -1;
}
Looks good to me --->"large_drop_target":"true".
'core' : {
'data' : {
'url' : '/management/categories/load',
'data' : {'objectContext' : objectContext},
'dataType': 'json'
},
'check_callback' : true,
'multiple' : false,
'themes' : {
dots : false, //should be "dots": false
variant : 'large' //should be "variant": "large"