-
2 Mar 2009 11:44 AM #1
[Solved] How to get totalProperty value from JsonReader?
[Solved] How to get totalProperty value from JsonReader?
Hello, I want to know is is possible to get the value from totalProperty from the following code:
I tried the following :Code:UsersDataStore = new Ext.data.Store({ id: 'UsersDataStore', proxy: new Ext.data.HttpProxy({ url: requestUrl, method: 'POST' }), baseParams: { task: 'LISTING', param: 'ALL' }, reader: new Ext.data.JsonReader({ root: 'results', totalProperty: 'total', id: 'id' }, . . . etc...
but i get "undefined" as result...Code:alert(UsersDataStore.reader.totalProperty)
-
2 Mar 2009 11:50 AM #2
reader isn't a public property. And I don't think totalProperty is one in DataReader. Try:
UsersDataStore.getReader().getTotalProperty()
(off the head, check the API to be sure)
-
2 Mar 2009 12:02 PM #3
I think you may be looking for: http://extjs.com/deploy/dev/docs/?cl...ember=jsonData
Try:
And the "total" property within jsonData depends on how you configured totalProperty in the first place.Code:var total = grid.store.reader.jsonData.total;
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
2 Mar 2009 12:05 PM #4
You don't state what you're really doing, but you may be looking for:
Code:store.getTotalCount();
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
2 Mar 2009 12:44 PM #5


Reply With Quote