ExtJS 4.2 Treepanel Click on tree node to transfer parameters to background (multiple parameters)

Source: Internet
Author: User

//*********************************************** 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.