PDA

View Full Version : Ho to get totalRecords?



MagicianVitja
7 Jun 2008, 6:33 AM
Ho to get totalRecords for ArrayReader?
Now I sent next data to client:


"{SourceDealers:[[\"key1\", \"name1\"], [\"key1\", \"name1\"]], total: 200}"
and declare store:
store = new Ext.data.Store({
reader: new Ext.data.ArrayReader(
{
totalRecords: 'total'
}
new Ext.data.Record.create([
{name : 'MARKET_NAME', mapping : 0},
{name : 'ID', mapping : 1}
]))
});

but it is wrong ..
why?

Animal
7 Jun 2008, 7:44 AM
You are using an ArrayReader. That reads flat Arrays of data.

The data you send is a Javascript literal (sometimes referred to as "JSON"), so you need a JsonReader.

MagicianVitja
8 Jun 2008, 4:32 AM
Thank you for answer.
I have understanded you ..