PDA

View Full Version : How to set totalRecords, if I use ArrayReader?



MagicianVitja
7 Jun 2008, 5:32 AM
Hi, everyone!
I need in good advice for next problem:
I have a store, and the store use Ext.data.ArrayReader for reading data from web server..
And my grid use the store as data source.
But the grid has to know how many pages saved in store (the property name: totalRecords)!
Question: How I have to sent data from server code to client code in order to fill totalRecords?
I use C# 2.0 .. and extjs 2.0 ..
now I sent a data as:
string ar = "[[\"key1\", \"name1\"], [\"key1\", \"name1\"]]";
string ar2 = "[1, \"sdfgsdf2\", \"dfvbsdfg2\"]";
Response.Write(@"{data:" + ar + @",digit:" + ar2 + @"}");
Response.End();

hendricd
7 Jun 2008, 10:21 AM
I believe you should take a look at PagingMemoryProxy (http://extjs.com/forum/showthread.php?t=11652). It fills in all your gaps (with sorted, filtered paging), and is 2.0+ compatible.