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

Jared Jurkiewicz jared.jurkiewicz at gmail.com
Mon Aug 20 23:29:45 EDT 2007

Ah, you want bidirectional references, effectively.  Well, the meaning
of an attribute doesn't have to mean 'children' on ItemFileReadStore.
You could always put a reference from a child node back to the parent
with a specific attr name, like 'parent'.  Anyway, it's something more
to explore/discuss on how to do.  I think this will get a bit more
complicated in not every dataset may have bidirectional capable items
in them.

-- Jared Jurkiewicz

On 8/20/07, Bill Keese <bill at dojotoolkit.org> wrote:
> Jared Jurkiewicz wrote:
> >   As for parent pointers ... ItemFileReadStore can do that today.
> > That's what the _reference type is for in the data file format.  You
> > give it a reference identifier to another item (or items) in the
> > store.
> >
> Hmm, you'll have to show me.  The examples I found use _reference to
> point to children:
>       { name:'Asia', type:'continent',
>           children:[{_reference:'China'}, {_reference:'India'},
> {_reference:'Russia'}, {_reference:'Mongolia'}] },
> rather than to point to the parent.
> Obviously you could use reference to point to the parent, but the
> problem is, how do I make store.getValues(asia, "children") return the
> list of children when that information isn't stored in the asia item?  IE:
> { name:'Asia', type:'continent' },
> { name: 'China', type: 'country', parent: {_reference: 'Asia'} }
> { name: 'India', type: 'country', parent: {_reference: 'Asia'} }
> ...
> > I had demos set up in dojox.data that did
> > Tree against multiple store implementations to validate that Tree,
> > ComboBox, etc, all worked properly against a variety of store impls.
> Yup, sorry about that.  We can try to remember to check dojox demos when
> changing dijits (we should do that anyway but it's easy to forget), or
> we can reference the dojox data stores from the dijit tests... not sure
> what makes sense.
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors

More information about the dojo-contributors mailing list