EasyUI Forum
May 09, 2024, 01:49:14 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: treegrid drag and drop of new nodes  (Read 8792 times)
sky-t
Full Member
***
Posts: 145


View Profile
« 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?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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');
Logged
sky-t
Full Member
***
Posts: 145


View Profile
« Reply #2 on: September 11, 2016, 09:15:03 PM »

works great - thanks a lot!
Logged
sky-t
Full Member
***
Posts: 145


View Profile
« Reply #3 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: September 12, 2016, 05:33:11 AM »

Please call the 'getData' method to get the loaded hierarchical data.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!