Just wondering is there a way to handle that in Sencha Touch. One store and after applying different filters, the store can be used for different places.
For example:
I have a store:
Ext.regModel('abc', {
fields: [{name: 'tid', type: 'int'}, {name: 'name', type: 'string'}, {name: 'parent', type: 'int'}]
});
var store = new Ext.data.Store({
model: 'abc',
proxy: {
type: 'ajax',
url : 'read.php',
reader: {
type: 'json',
root: 'items',
fields: ['tid', 'name', 'parent']
}
},
autoLoad: true,
});
And in a FormPanel, it has two selectfields:
items: [
{
xtype: 'selectfield',
name : 'One',
label: 'Category',
// store: store, <-- Load the whole store
store: function(){
store.filter('name', 'digital'); <-- Load part of store
},
displayField: 'name',
valueField: 'tid'
},{
xtype: 'selectfield',
name : 'Two',
label: 'subCategory',
// store: store, <-- Load the whole store
store: function(){
store.filter('parent', 1); <-- Load part of store
},
displayField: 'name',
valueField: 'tid'
},{
...}
]
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)