PDA

View Full Version : Static TreeView



Phpex
21 Nov 2007, 11:55 PM
I need to do a treeview which loads Json data from an url only one time (on showing panel for the first time)

Do i need to write empty functions for all actions like click, expand etc?

How can i do this in a simple and practical way?

Phpex
22 Nov 2007, 6:15 AM
I do this like this :



var luwig = 0; // a variable that will be changed after first load of the tree
Ext.extend(Application.SubWindowTreeLoader, Ext.tree.TreeLoader, {
dataUrl: 'http://someurl.php',
requestData : function(node, cb){
if ( luwig == 0 ) {
this.proxy.load({}, {
readRecords : function(o){
return o;
}
},
this.addNodes, this, {node:node, cb:cb});
}
else {
}
luwig = 1;
},


It works.