Adding nodes to a tree after rendering the page
Hi,
I am trying to add more child nodes to the existing tree after rendering the page by using onclick event. Is there any function to add directly the child nodes to the tree with onclick event??
Here is my example tree code:
var newtree1 = new AW.UI.Tree;
var tree = {
0: [1, 2, 3, 4],
1:[5, 6],
2:[7, 8],
3:[9, 10, 11]
};
var mytree = ["", "Home", "Favorites", "Search", "Test", "Child1",
"Child2", "Child3", "Child4", "Child5", "Child6", "Child7", "Child8"];
newtree1.setItemText(mytree);
newtree1.setViewCount(function(i) {return tree[i] ? tree[i].length : 0});
newtree1.setViewIndices(function(i) { return tree[i]});
newtree1.setEvent("onclick", myEventHandler);
function myEventHandler(event){
alert(this.getTag());
}
document.write(newtree1);
Thanks for the help!
I am trying to add more child nodes to the existing tree after rendering the page by using onclick event. Is there any function to add directly the child nodes to the tree with onclick event??
Here is my example tree code:
var newtree1 = new AW.UI.Tree;
var tree = {
0: [1, 2, 3, 4],
1:[5, 6],
2:[7, 8],
3:[9, 10, 11]
};
var mytree = ["", "Home", "Favorites", "Search", "Test", "Child1",
"Child2", "Child3", "Child4", "Child5", "Child6", "Child7", "Child8"];
newtree1.setItemText(mytree);
newtree1.setViewCount(function(i) {return tree[i] ? tree[i].length : 0});
newtree1.setViewIndices(function(i) { return tree[i]});
newtree1.setEvent("onclick", myEventHandler);
function myEventHandler(event){
alert(this.getTag());
}
document.write(newtree1);
Thanks for the help!
Aish
December 8,