This deals with queries similar to sql like getting number of records from a json store based on conditions, getting a record etc,
Ex: To get the no of records with title “xxx” from the below json data store,
var dataList = {
“data”: [{
“id”: 1,
“title”:”xxx”,
},
{
“id”: 2,
“title”:”yyy”
}]
};
var sampleStore = new Ext.data.JsonStore({
id: ‘sampleStore’,
..
data:dataList,
..
});
Use this,
sampleStore.query(“title”, “xxx”)).getCount()
To get the record by id,
sampleStore.getById(id)
To get the record at particular index,
sampleStore.getAt(index)
Steve c
February 8, 2012 at 12:05 am
doesn’t the query line have an extra bracket?
Creators
February 15, 2012 at 11:44 am
which line?