//*********************************************** left tree begins ***********************************************//Group Tree StorevarTreestore = ext.create (' Ext.data.TreeStore '), {proxy: {type:' Ajax ', URL:"/handler/storepositionlayouthandler.ashx?func=getbystorestorepositionlist&format=list"}, AutoLoad:false, fields: [' Text ', ' id ', ' leaf ', ' splid ', ' splname ', ' StoreId ', ' Level1 ', ' Level2 ', ' Level3 ', ' LevelType '], Reader: {type:"JSON", Root:‘‘}, Extraparams: {splid:‘‘, StoreId:‘‘, Level1:‘‘, Level2:‘‘, Level3:‘‘, LevelType:‘‘, }});//Group TreevarTreepanel = ext.create (' Ext.tree.Panel '), {store:treestore, border:false,//BorderEnabledd:true, rootvisible:false,//Hide root nodeUsearrows:true,//tree nodes use arrowsContainerscroll:true, Collapsible:false, AutoScroll:false, Title:' Shelf Information list ', Columns: [{xtype:' Treecolumn ', Text:' Shelf level ', Dataindex:' Text ', Width:150, sortable:true}, {text:' Shelf name ', Dataindex:' Splname ', Flex:1, sortable:true }], //Click on the directory tree + to assign a value to the root parameterlisteners: {//Tree List Click to assign value to id:xxxx text boxItemClick:function(node, record, item, index, event, eopts) {//assign a value to the right page start varID =record.data.id; varText =Record.data.text; varSplid =record.data.SPLId; varSplname =Record.data.SPLName; varStoreId =record.data.StoreId; Belowform.settitle (' Current shelf: ' + text + ' +splname); BelowForm.form.findField (' Splid '). SetValue (Splid); BelowForm.form.findField (' Splname '). SetValue (Splname); //end of assignment to right page }, //Click on the directory tree + to assign a value to the root parameterBeforeitemexpand:function(record, eopts) {if(Treepanel! =undefined) { varRoot =TreePanel.store.getProxy (); Root.extraParams.SPLId=record.data.SPLId; Root.extraParams.StoreId=record.data.StoreId; Root.extraParams.Level1=Record.data.Level1; Root.extraParams.Level2=Record.data.Level2; Root.extraParams.Level3=Record.data.Level3; Root.extraParams.levelType=Record.data.levelType; } } } //singleexpand:true//shows a single child node, and other child nodes are merged. });//Treepanel.expandall ();//Expand All nodesTreepanel.collapseall ();//Close all nodes//*********************************************** Left tree end ***********************************************
ExtJS 4.2 Treepanel Click on tree node to transfer parameters to background (multiple parameters)