PDA

View Full Version : How to pass extra params to the store using the storeId



tsensuous.grace
2 Dec 2016, 3:20 PM
I want to access a param inside a store created. below is my store:



Q.define('test.DataStore', Ext.data.ArrayStore, function($supr){
return { constructor: function(cfg) {
$supr().constructor.call(this, {
storeId: 'DataRule',
data :[
['SEARCH', 'Search')],
['SEARCH2', 'Search2')],
['SEARCH3', 'Search3')],
]
});
}
}; }
);

and here is how im accessing the store from:

items : this.section({
items : [{
store: 'DataRule' //using the store id defined in the store above }, { xtype : 'box',
width : 10,
}]
}]

I want some params to be passed to the store, i.e [{id:'1'},{id: '2'}]. How can I pass params to be able to access inside the store?

Thanks!

Gary Schlosberg
13 Dec 2016, 3:25 PM
Sorry, I'm not sure I understand. Are you looking to filter store records?
http://docs.sencha.com/extjs/4.2.6/#!/api/Ext.data.Store-method-filter