extjs4 - pass two id s in extjs 4 tree multiSelect and pass one id in single click -


when user selects 1 or many rows in tree, set row's ids onto url of store proxy. here current code:

var treepanel = ext.create('ext.tree.panel', {     id: 'tree-panel',     title: 'taxonomy',     region:'west',     collapsible: true,     split: true,     multiselect: true,                               height:'100%',            width: '20%',     minwidth: 100,     rootvisible: false,     autoscroll: true,     store: store,     viewconfig: {         allowcopy: true,         plugins: {             ptype:      'treeviewdragdrop',             appendonly: true,             ddgroup:    'seldd'         }     } }); 

and here code setting 'select' event:

treepanel.getselectionmodel().on('select', function(selmodel, record) {     var selectednode = treepanel.getselectionmodel().getselection();     if (multiselect,true) {         treeid=selectednode[0].data.id;         //if(treeid = 'null'){         store1.proxy.url='json/json.php?taxee_id=<?php echo $taxe_id;?>&id=' + selectednode[0].data.id ;         store1.load();     }     else     {         store1.proxy.url='json/json.php?taxee_id=<?php echo $taxe_id;?>&id=' + selectednode[0].data.id + '&id1='+ selectednode[1].data.id ;         store1.load();     } }); 

this work if problem:

treepanel.getselectionmodel().on('select', function(selmodel, record) {     var selectednode = treepanel.getselectionmodel().getselection();     if(selectednode.length > 0)     {         var proxyurl = 'json/json.php?taxee_id=<?php echo $taxe_id;?>&id=' + selectednode[0].data.id;         for(var = 1; < selectednode.length; i++)             proxyurl += '&id' + + '='+ selectednode[i].data.id;         store1.proxy.url = proxyurl;         store1.load();     } }); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -