Thursday, 12 September 2013

Sencha Touch delete records in store based on condition

Sencha Touch delete records in store based on condition

I have a store with following code. I have 7 records in my store in which
first 3 record are having a status 2 and others have the status 3. I want
to delete the records whose status is 2.How do i go about
Ext.define('MyApp.store.MyStore', { extend: 'Ext.data.Store',
config: {
data: [
[
1,
'Siesta by the Ocean',
'1 Ocean Front, Happy Island',
1
],
[
2,
'Gulfwind',
'25 Ocean Front, Happy Island',
1
],
[
3,
'South Pole View',
'1 Southernmost Point, Antarctica',
1
],
[
4,
'ABC',
'11 Address1',
2
],
[
5,
'DEF',
'12 Address2',
2
],
[
6,
'GHI',
'13 Address3',
2
],
[
7,
'JKL',
'14 Address4',
2
]
],
storeId: 'MyStore',
fields: [
{
name: 'id',
type: 'int'
},
{
name: 'name',
type: 'string'
},
{
name: 'address',
type: 'string'
},
{
name: 'status',
type: 'int'
}
],
proxy: {
type: 'localstorage'
}
}
});

No comments:

Post a Comment