Ext.ns("feyaSoft.oilAccount.share.search");feyaSoft.oilAccount.share.search.ProductPanel=function(config){this.westPanel=new feyaSoft.oilAccount.share.search.ProductWestPanel();this.listProduct=new feyaSoft.oilAccount.share.search.ListProduct(config);feyaSoft.oilAccount.share.search.ProductPanel.superclass.constructor.call(this,{border:false,layout:"border",items:[this.westPanel,this.listProduct]});this.on("afterlayout",function(){this.initLoadData()},this,{single:true})};Ext.extend(feyaSoft.oilAccount.share.search.ProductPanel,Ext.Panel,{initLoadData:function(){this.listProduct.initLoadData()},loadAllProduct:function(){this.listProduct.loadAll()},reloadProduct:function(){this.listProduct.reload()},loadKeyword:function(name){this.listProduct.loadKeyword(name)},loadRegion:function(id){this.listProduct.loadRegion(id)}});feyaSoft.oilAccount.share.search.ProductWestPanel=function(config){this.urlLoader=new Ext.tree.TreeLoader({dataUrl:"accountProductsEquipment/listTree",baseParams:{id:"0"}});this.fileTree=new Ext.tree.TreePanel({loader:this.urlLoader,containerScroll:true,rootVisible:false,lines:false,autoScroll:true,root:new Ext.tree.AsyncTreeNode({text:"ROOT",expandable:true,draggable:false,cls:"folder",expanded:true,id:"0"})});feyaSoft.oilAccount.share.search.ProductWestPanel.superclass.constructor.call(this,{region:"west",title:"Search By",split:true,width:200,collapsible:true,border:true,layout:"fit",layoutConfig:{animate:true},items:[this.fileTree]});this.fileTree.on("click",this.onClickHandler,this);this.fileTree.getLoader().on("load",function(){if(this.fileTree.getRootNode()){this.fileTree.getRootNode().firstChild.select()}},this,{single:true})};Ext.extend(feyaSoft.oilAccount.share.search.ProductWestPanel,Ext.Panel,{initLoadData:function(){},onClickHandler:function(node,obj,options){if(!node.hasChildNodes()&&node.isLeaf()){var id=node.attributes.id;var temp=id.split("_");if(id=="all"){this.ownerCt.loadAllProduct()}else{if(temp[0]=="keyword"){this.ownerCt.loadKeyword(temp[1])}else{if(temp[0]=="region"){this.ownerCt.loadRegion(temp[1])}}}}}});
