Opened 15 years ago

Closed 15 years ago

#2544 closed enhancement (fixed)

[] document paging API, and provide reference implementation

Reported by: skinner Owned by: skinner
Priority: high Milestone: 0.9
Component: Data Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:


At our IRC meeting on 2007-02-27 we picked a standard paging API for the Read API. The paging API is documented in the meeting notes, but we need to also update the doc-comments in the file. We should also implement the paging API in (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: 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{url:"movies.csv"})).find().fetch({onItem: callback}); //for all items
(new{url:"movies.csv"})).find().fetch({onItem: callback,/*std callbacks*/ ,start:50, count:40}); //for items 50-89

Change History (1)

comment:1 Changed 15 years ago by Adam Peller

Resolution: fixed
Status: newclosed

See #2704

Note: See TracTickets for help on using tickets.