extjs - Work with associations on server side; table relationships -


i need this, on server side. http://dev.sencha.com/ext/5.1.0/examples/kitchensink/#binding-associations

my code (when select 1 customers grid row):

selectionchange: function(sm, grid, value, selected, eopts) {      var storecustomers = grid.getstore();      var gridorders = ext.componentquery.query('#gridordersitemid')[0];     var storeorders = gridorders.getstore();              var id_customers = storecustomers.findrecord('id_customers', value); //it not work; return null      console.log(id_customers ); //null     console.log(value); //undefined      storeorders.proxy.extraparams = {             'id_customers': id_customers     },      storeorders.load(); 

}

for reason can not value of id_customers when select grid record. result null.

any idea how solve this?

thanks in advance.

edited: 06-07-2015

selectionchange: function(sm, grid, record, value, selected, eopts) {      var storecustomers = grid.getstore();      var gridorders = ext.componentquery.query('#gridordersitemid')[0];     var storeorders = gridorders.getstore();             var records = grid.getselectionmodel().getlastselected(record);      storeorders.proxy.extraparams = {             'id_customers': records.get('id_customers')     },      storeorders.load(); 

}

regarding this:

for reason can not value of id_customers when select grid record. result null.

here possible solution:

selectionchange: function(grid, records) {     var storeorders = ext.componentquery.query('#gridordersitemid')[0]                                         .getstore();     storeorders.proxy.extraparams = {             'id_customers': records[0].get('id_customers')     },     storeorders.load(); } 

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -