EasyUI Forum

General Category => Bug Report => Topic started by: sky-t on September 11, 2016, 03:20:20 AM



Title: treegrid drag and drop of new nodes
Post by: sky-t on September 11, 2016, 03:20:20 AM
When i'am adding new nodes to treegrid by using append these new nodes can't be moved with drag and drop.
Already existing nodes can be moved. I'am using the latest treegrid-dnd.js.

What's wrong here?


Title: Re: treegrid drag and drop of new nodes
Post by: stworthy on September 11, 2016, 05:19:49 PM
After append a new node, you should call 'enableDnd' method to make it draggable and droppable.
Code:
$('#tg').treegrid('append', {
parent: 2,
data:[{
id:'2221',
name:'name2221'
}]
});
$('#tg').treegrid('enableDnd', '2221');


Title: Re: treegrid drag and drop of new nodes
Post by: sky-t on September 11, 2016, 09:15:03 PM
works great - thanks a lot!


Title: Re: treegrid drag and drop of new nodes
Post by: sky-t on September 12, 2016, 05:00:46 AM
and what ist the right way to get all nodes (roots and their children) in one function - getData doesn't seem to work


Title: Re: treegrid drag and drop of new nodes
Post by: stworthy on September 12, 2016, 05:33:11 AM
Please call the 'getData' method to get the loaded hierarchical data.