javascript - How to filter from a combobox in Sencha-touch? -
i trying filter in combobox under sencha touch framework not loading correct records in list.
my code is:
ontemplatesfilterchoosen: function(field, newvalue, oldvalue){ var store = ext.getstore('customers'), templatesstore = store.getat(0).templates(), //get associated store text = field.getrecord().data.text; templatesstore.clearfilter(); //here code filter main store based in records of associated store }
but not working correctly , store.getcount()
for example 0, showing empty list.
in main model adding new model based in properties of filter called "customertemplatemodel"
associations: [ { type: 'hasmany', associatedmodel: 'x.customer.model.customertemplatemodel', ownermodel: 'x.customer.model.customermodel', associationkey: 'templates', autoload: true, filterproperty: 'value', name: 'templates' } ]
and here model associated:
ext.define('x.customer.model.customertemplatemodel', { extend: 'ext.data.model', requires:[ ], config: { usecache: false, rootproperty: 'templates', fields: [ { name: 'text', type: 'string' }, { name: 'value', type: 'string' } ] } });
what doing wrong??
thank in advance.
Comments
Post a Comment