nostalgieing
15 Oct 2012, 1:30 PM
Hi,I ama a begginer in extjs developpement and i have a problem to filter a store
I have a store containing data which can find duplicates like this example:
var store = Ext.create('Ext.data.JsonStore', {
fields: ['id','name' ],
data: [
{'id':1,'name':'name1'},
{'id':2,'name':'name2' },
{'id':3,'name':'name2'},
{'id':4,'name':'name1'},
{'id':5,'name':'name3'}
]
});
I want to apply a filter to extract this data store to another store (array. ..) the value of field 'name' and the number of occurrences of each value of the field:
As this example:
var store1 = Ext.create('Ext.data.Store', {
fields:['value', 'occurence'],
data:[
{'name1', 2},
{'name2', 2},
{'name3', 1}
] });
I try to use find() and filter() but i failed to have a store that perofrms the search.
I need your help
I have a store containing data which can find duplicates like this example:
var store = Ext.create('Ext.data.JsonStore', {
fields: ['id','name' ],
data: [
{'id':1,'name':'name1'},
{'id':2,'name':'name2' },
{'id':3,'name':'name2'},
{'id':4,'name':'name1'},
{'id':5,'name':'name3'}
]
});
I want to apply a filter to extract this data store to another store (array. ..) the value of field 'name' and the number of occurrences of each value of the field:
As this example:
var store1 = Ext.create('Ext.data.Store', {
fields:['value', 'occurence'],
data:[
{'name1', 2},
{'name2', 2},
{'name3', 1}
] });
I try to use find() and filter() but i failed to have a store that perofrms the search.
I need your help