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
An example at dojocampus demonstrates one way. Here a fetch
without query
parameter returns all the items in the store.
var store = new some.Datastore();
var gotItems = function(items, request){
console.log("Number of items located: " + items.length);
};
store.fetch({onComplete: gotItems});
dojo.data.api.Read's onBegin function has the total size of the match:
function size(size, request){
// Do whatever with the size var.
}
store.fetch({query: {}, onBegin: size, start: 0, count: 0});
From this quickstart: http://dojotoolkit.org/reference-guide/1.7/quickstart/data/usingdatastores/faq.html#question-6-how-do-i-get-a-count-of-all-items-in-a-datastore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With