Ticket #2544 (closed enhancement: fixed)
[dojo.data] document paging API, and provide reference implementation
| Reported by: | skinner | Owned by: | skinner |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.9 |
| Component: | Data | Version: | 0.4.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
At our IRC meeting on 2007-02-27 we picked a standard paging API for the dojo.data Read API. The paging API is documented in the meeting notes, but we need to also update the doc-comments in the dojo.data.core.Read.js file. We should also implement the paging API in dojo.data.SimpleBaseStore? (or in some other base class), both to serve as a reference implemenation and also to provide a generic implementation so that sub-class authors don't need to think about paging at all.
Here are the meeting notes: http://dojo.jot.com/2007-02-27 Here's what the API looks like:
// count is *optional* hint for num items on initial result
var result = store.find({query:'hobbit', count:20});
// count is passed on as property on result
result.fetch({onItem:callback, start:0, count:20}); // get items 1 to 20
result.fetch({onItem:callback, start:20, count:20}); // get items 21 to 39
// or more simply...
(new dojo.data.CsvStore({url:"movies.csv"})).find().fetch({onItem: callback}); //for all items
(new dojo.data.CsvStore({url:"movies.csv"})).find().fetch({onItem: callback,/*std callbacks*/ ,start:50, count:40}); //for items 50-89
Change History
Note: See
TracTickets for help on using
tickets.