[dojo-contributors] TreeGrid enhancement for 1.6 - lazy loading for children rows

Jonathan Bond-Caron jbondc at gmail.com
Fri Oct 1 13:34:43 EDT 2010


There's an alternative which I've put online here:
http://bugs.dojotoolkit.org/attachment/ticket/11537/data_model.patch

In short, it would be practical to separate to 'storage api' and the 'model
api'.

For storage:

In SQL terms:
SELECT, UPDATE or INSERT, DELETE, ~ SELECT * FROM information_schema.columns

In Dojo terms:
query() or get(), put(), remove(), getModel()

> On 9/29/2010 3:25 AM, Bill Keese wrote:
> > A getChildren(....., {start:*, count:*, ...}) method sounds 
> > reasonable. Would that method be on the store or on the item?
> > I've been assuming that getChildren()'s return value is similar to 
> > store.query()'s.

With the data model approach, you would use ~

dm = store.getModel(); 

if( dm.getProperty('hasChildren', itm) ) {
  // create a new data store for node 'itm' that will lazy load children or
fetch right way...
  
}

> 
> > I'm not sure either about a good API to get the number of items
> > getChildren() will return. How do you find out how many items a top 
> > level query will return (as passed to store.query())? (I looked at 
> > http://docs.dojocampus.org/dojo/store but it's not explicit.)
> The "total" property on the object/array returned from the query 
> should be the total (so presumably getChildren would do the same).

But there has to be a way for a client/widget as to ask the server "please
compute the total number of records".

start - Starting offset
count - Number of objects to return
sort  - Follows the Dojo Data sort definition
total - (Boolean) Ask server to compute the total number of records and
return it in QueryResponse

This is something I've struggled with the old api




More information about the dojo-contributors mailing list