[dojo-contributors] Dojo.data + filter of nest structures

Evan Huang evanhuangwei at gmail.com
Wed Mar 9 10:24:01 EST 2011


Yep, this issue exists across LazyTreeGrid/TreeGrid/Tree, as the
behavior of filtering nested data structures is not consistent across
datasotres, though we have a optional {deep:true} as queryOptions in
fetch() API, it depends more on a datastore impl(especially users'
customized server side stores) how it's interpreted which then
determines the return filtered data(nested).

I think the appropriate place to add this filtering support would be
TreeModel which provides consistent behavior of filtering nested data.
The TreeModel should also be generically work well with various stores
impl(if in supposed nested structures) - I remember there are related
threads on this and might be already something in plan/progress for
new store? - FIXME

- Evan

On Wed, Mar 9, 2011 at 9:10 AM, Karl Tiedt <ktiedt at gmail.com> wrote:
> Inline
>
> -Karl Tiedt
>
>>> Example:
>>> Toplevel-1
>>>     Toplevel-1-SecondLevel-1
>>>             Toplevel-1-secondLevel-1-ThirdLevel-1
>>>             Toplevel-1-secondLevel-1-ThirdLevel-2
>>>             Toplevel-1-secondLevel-1-ThirdLevel-3
>>>
>>> Now if we say the above text is the name of each item, then filter on
>>> ThirdLevel-3 it *should* return:
>>>
>>> Toplevel-1
>>>     Toplevel-1-SecondLevel-1
>>>             Toplevel-1-secondLevel-1-ThirdLevel-3
>>>
>>> However, currently the entire childrens array is displayed... a
>>> possible solution would be to filter with deep=true, however this
>>> returned a flattened result set from what we saw
>>
>> what is "the entire childrens" array in your example?
>
> Top example has 3 children in lowest level, thats the entire children
> array for its parent... bottom example has properly filtered childrens
> array showing only the matching child + parents to display it properly
>
>
>>
>> are you talking about dojo.store or dojo.data?
>>
>
> Currently these are dojox.data.AndOrReadStore and ItemFileReadStore
> that we have looked at (due to project usage) - project is based on
> Dojo 1.5 atm but updating to 1.6 soon as approval comes down
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
>


More information about the dojo-contributors mailing list