E
egarcia
Guest
Hello Carl, You are welcome. I am glad to share the knowledge. I think that the approach that you mentioned seems possible. My concern is that only refreshing the count at when reaching the last page might not be sufficient. In some cases, you might want to know that the number of records changed on the server. Please feel free to submit an idea for enhancing the count operation. Considering that you would like to try this out and see how effective it would be, I would like to share some code that you can try out: var totalRecords; customerJSDO.myCount = function () { var request = {}, promise; if (totalRecords) { request.deferred = $.Deferred(); request.response = { numRecs: totalRecords }; request.deferred.resolve(customerJSDO, true, request); return request; } else { request = customerJSDO.count.apply(this, arguments); request.deferred.promise().done(function (jsdo, success, request) { // console.log("DEBUG: " + request.response.numRecs); totalRecords = request.response.numRecs; }); return request; } }; You can try see this in the example at oemobiledemo.progress.com/.../example014p.html . The logic on detecting the number of records is greater than the page size is not hard... you can call getData() on the JSDO instance. I look forward to see how this works for your scenario.
Continue reading...
Continue reading...