jstree drag and drop on root level is not possible

319 views
Skip to first unread message

Killua Zoldyck

unread,
Aug 23, 2017, 1:59:08 AM8/23/17
to jsTree

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;
       
}


Derrick Keith

unread,
Oct 20, 2017, 11:05:08 PM10/20/17
to jsTree
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"
Reply all
Reply to author
Forward
0 new messages