[dojo-contributors] tree/dojo.data problems (nee: Re: [Dojo-interest] [ANN] Dojo 0.9 Final)

Bill Keese bill at dojotoolkit.org
Mon Aug 20 21:41:48 EDT 2007


Jared Jurkiewicz wrote:

> Basically, it breaks dijit.Tree from working with any dojo.data
> Datastore except for ItemFileReadStore.

That's too bad, although not surprising. (In general things that haven't 
been tested don't work.)  I'm sure we'll find lots of other big problems 
too, but they'll all get fixed in the end.

You can workaround by setting:

<script>
myStore._features = {};
</script>

As for the identity API, Tree doesn't assume the store implements 
getIdentity() but rather requires it, in the same way that Combobox 
requires that it's store support filtering queries like "ca*".  It's a 
subtle semantic difference.

I'd like to agree w/Brian that all stores should implement getIdentity() 
but maybe some data just doesn't have an id column?   For any store 
where an id is possible to compute, I think you can make the store to 
support getIdentity() in your markup w/the script tag:

<div dojoType="dojox.data.fooStore" ...>

	<script type='dojo/method' event='getIdentity' args=item>
		return ... ;
	</script>

</div>

If supporting getIdentity() is an issue that we could make sure the tree 
only requires getIdentity() if the store is also supporting the write API.

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?  It seems 
like we have to either modify the store to support getChildren() by 
doing a query for all nodes with a given parent, or change the way Tree 
works.



More information about the dojo-contributors mailing list