S
shotokan99
hi guys,
my question is regarding yui tree menu. im a newbie and trying to take
advantage of this rich library. my worry is about removeNode() or
how to remove or delete a node on real-time.
i have a code that contains a button and when the user push this
button it will create a node on real-time. and my code goes like this:
function addbtn(){
g=prompt('New Node Name: ','');
if(g.length>0){
e=g;
e=new YAHOO.widget.TextNode(g,mytree.getRoot(),false);
mytree.draw();
}
}
i think i'm ok with it, works well for now and does the trick. now if
i want to remove that recent node my code goes like this:
function rembtn(){
p=prompt('What Node to remove:','');
if(p.length>0){
mytree.removeNode(eval(p),true);
mytree.draw();
}
}
for instance i added a node "games". now upon removing, if type
"games" it will give me an error. but if i type "e", which is the
variable name when i created a node from addbtn() it runs
successfully. can someone pls tell me the work around for my issue?
tnx
my question is regarding yui tree menu. im a newbie and trying to take
advantage of this rich library. my worry is about removeNode() or
how to remove or delete a node on real-time.
i have a code that contains a button and when the user push this
button it will create a node on real-time. and my code goes like this:
function addbtn(){
g=prompt('New Node Name: ','');
if(g.length>0){
e=g;
e=new YAHOO.widget.TextNode(g,mytree.getRoot(),false);
mytree.draw();
}
}
i think i'm ok with it, works well for now and does the trick. now if
i want to remove that recent node my code goes like this:
function rembtn(){
p=prompt('What Node to remove:','');
if(p.length>0){
mytree.removeNode(eval(p),true);
mytree.draw();
}
}
for instance i added a node "games". now upon removing, if type
"games" it will give me an error. but if i type "e", which is the
variable name when i created a node from addbtn() it runs
successfully. can someone pls tell me the work around for my issue?
tnx