I don’t see anything in the read API that provides access to this:
http://api.dojotoolkit.org/jsdoc/1.3.2/dojo.data.api.Read
I don’t see anything in the read API that provides access to this: http://api.dojotoolkit.org/jsdoc/1.3.2/dojo.data.api.Read
Share
The format of the wire-data of any data store is completely store-specific. In order for you to get the total items count (and other metadata), it must be returned as part of the response. This is the only way to do server-side pagination.
All the stores I have implemented expect the data to contain a
totalCountattribute, like so:The store saves this when the query returns (in
onComplete). The value is then exposed via agetTotalCount()method on the store.When used in conjunction with the
startandcountrequest options, this allows you to have nice ajax pagination (“Showing 1-50 of 525”).Since this is not part of the API, the core implementations of the read API do not implement it. A form of this technique (similar to what I have done) does seem to be implemented by the
dojo.data.QueryReadStore, so you can probably look there also.