2
* Ext JS Library 3.0 RC2
3
* Copyright(c) 2006-2009, Ext JS, LLC.
6
* http://extjs.com/license
10
Ext.tree.AsyncTreeNode=function(config){this.loaded=config&&config.loaded===true;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents('beforeload','load');};Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(deep,anim,callback,scope){if(this.loading){var timer;var f=function(){if(!this.loading){clearInterval(timer);this.expand(deep,anim,callback,scope);}}.createDelegate(this);timer=setInterval(f,200);return;}
11
if(!this.loaded){if(this.fireEvent("beforeload",this)===false){return;}
12
this.loading=true;this.ui.beforeLoad(this);var loader=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(loader){loader.load(this,this.loadComplete.createDelegate(this,[deep,anim,callback,scope]),this);return;}}
13
Ext.tree.AsyncTreeNode.superclass.expand.call(this,deep,anim,callback,scope);},isLoading:function(){return this.loading;},loadComplete:function(deep,anim,callback,scope){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(deep,anim,callback,scope);},isLoaded:function(){return this.loaded;},hasChildNodes:function(){if(!this.isLeaf()&&!this.loaded){return true;}else{return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this);}},reload:function(callback,scope){this.collapse(false,false);while(this.firstChild){this.removeChild(this.firstChild).destroy();}
14
this.childrenRendered=false;this.loaded=false;if(this.isHiddenRoot()){this.expanded=false;}
15
this.expand(false,false,callback,scope);}});Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode;
b'\\ No newline at end of file'