EasyUI Forum
September 13, 2025, 12:04:50 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Question about remove tree node  (Read 11349 times)
nyr_jack
Newbie
*
Posts: 31


View Profile
« on: January 05, 2013, 01:05:33 AM »

when remove a root of tree , but there's a bug "0.target is null or". How can I remove the root of tree correctly, please help.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 05, 2013, 02:36:36 AM »

How do you remove the root node? Please try the code below.
Code:
var roots = $('#tt').tree('getRoots');
for(var i=0; i<roots.length; i++){
$('#tt').tree('remove',roots[i].target);
}
Logged
nyr_jack
Newbie
*
Posts: 31


View Profile
« Reply #2 on: January 05, 2013, 06:27:50 PM »

I tried, but the bug wasn't solved. I think, maybe when I removed all roots of tree, then the tree is empty , so occur the bug '0.target is null or...'  , is it right? If I'm right, how can I do ? I'v paste my codes to General Discussion, you can write a 'remove' function to try.

http://www.jeasyui.com/forum/index.php?topic=1047.0
« Last Edit: January 05, 2013, 10:47:11 PM by nyr_jack » 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!