[dojo-contributors] tree/dojo.data problems

Brian Douglas Skinner skinner at dojotoolkit.org
Tue Aug 21 14:47:39 EDT 2007


Bill Keese wrote:
> By the way, I'm looking at making another demo now and I've 
> realized that Tree won't really work for normal relational 
> data where items have parent "pointers" rather than children 
> lists.  IE:
> 
> {type: "country", name: "united states", id: "US"},
> {type: "state", name: "california", id: "CA", parent: "US"}
> 
> That seems like the biggest issue of all to me.  Any ideas?  

In some cases the datastore implementation could provide the "child" 
attribute you need, even if the underlying data source is a relational 
database.

Say you have a Geography database with relational tables like these:

   NAME  ID  COUNTRY
   Utah  UT  USA
   Ohio  OH  USA

   ID   NAME
   UKR  Ukraine
   USA  United States

In the Geography datastore, the items for "Ukraine" and "United States" 
might have attributes "Name", "Id", and "States", even though there's no 
column for STATE in the COUNTRIES table.

:o) Brian




More information about the dojo-contributors mailing list