views:

13

answers:

1

So I tried to format this properly the first time, but it published and all the stuff in carets wasn't parsed properly, so I'll try again:

I have been trying to decide what the best way to filter a set of data for a tree view is.

The filters are in the following XML format: using periods instead of carots

Filtering two datasets: . AND

Basically the filters either include something from the full dataset into the result set or exclude, plus the special conditions below.

So I've been thinking about writing special conditions for the following, which are required at times because some of the data in a SpecificItem attribute-"" is coma delimited

condition (when critieria has to be evaluated as indexOf()) condition (when criteria applies to a SuperCat) condition (when multiple filters of same category, include expands) condition (when multiple categories being filtered, include narrows)

How can I write a simple function without multiple cases that meets these special conditions, and does typical standard filtering, loops through the multiple data sets to filter.

I've already written out a bunch of specific cases that make this all possible, but I feel like there should be a much simpler, better, and maybe more correct way to do this.

A: 

Ya it looks like the XML isn't parsing.... at all, so here it is without carets but indented

So I tried to format this properly the first time, but it published and all the stuff in carets wasn't parsed properly, so I'll try again:

I have been trying to decide what the best way to filter a set of data for a tree view is.

The filters are in the following XML format: using periods instead of carots Category FilterCategory(sometimes) FilterAgainstAttribute, FilterDataToCompare, FilterCategory
Filter Attributes(FilterAgainstAttribute, FilterDataToCompare, FilterCategory / /FilterCategory(sometimes) /Category>

Filtering two datasets: . SuperCategory Attributes SubCategory Attributes SpecificItem Attributes AND SuperCategory Attributes SpecificItem Attributes

mprototype
The text editor here won't return the hierarch formating or indents, just find my earlier post and replace periods with cartes
mprototype