Hi,
I have a ext treepanel with json.
var tree = new Ext.tree.TreePanel({
renderTo:'tree-container',
title: 'Category',
height: 300,
width: 400,
useArrows:true,
autoScroll:true,
animate:true,
enableDD:true,
containerScroll: true,
rootVisible: false,
frame: true,
root: {
text: 'Category',
draggable: false,
id: '0'
},
// auto create TreeLoader
dataUrl: $("#web").val() + "/category/index/get-nodes",
listeners: {
'checkchange': function(node, checked){
if(checked){
categoryManager.add(node.id);
//node.getUI().addClass('complete');
}else{
categoryManager.remove(node.id);
// node.getUI().removeClass('complete');
}
}
}
});
dataUrl loads the following json code
[{"text":"Code Snippet","id":"1","cls":"folder","checked":false,"children":[{"text":"PHP","id":"3","cls":"file","checked":false,"children":[]},{"text":"Javascript","id":"4","cls":"file","checked":false,"children":[]}]}]
when I try to find a node by console.log( tree.getNodeByid(3) ), it shows that it is undefined.
Do I have a problem with my code?