Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Michal on Sep 07, 2008 01:21
open dhtmlx forum
Filtering the tree

We plan to use the tree in our project, but the most important function of it, will be filtering. I do not see any options in the API for rows filtering in the tree. We need to filter leafs by names, and filter out those branches, which do not contain any leafs with provided name.
Is it possible at all? If no, is it planned for the next release? It would be nice to know before purchase.
Answer posted by Support on Sep 08, 2008 06:00
dhtmlxTree doesn't support such functionality. 
Such functionality supported by dhtmlxTreeGrid , but this component more oriented on showing grid-like info.

In case of dhtmlxTree , it possible to make some custom filtering function, which will check names|state of items, and change their visibility through setItemStyle command, but it will be not very stable|fast solution. 
Answer posted by michal on Sep 08, 2008 07:03

Thanks you for so fast answer.

What about storing the tree in JS array, and rebuilding whole tree from filtered array each time user press "filter" button? It should be faster than hiding items by setItemStyle individualy? We have about 2 thousands of leafs, and do not plan to exceed 5 thousands in a few years if ever. The time difference between different solutions can be noticable?

Do you plan to introduce filter ability to the tree in the future?

Answer posted by Support on Sep 08, 2008 10:11
>>What about storing the tree in JS array, and rebuilding whole tree from filtered array each time user press "filter" button?
This will work definitely faster. Especially if you will use JSON based tree with smartXMLParsing enabled ( jsarray requires inner converthion, so it is not the best choice )
With well formed tree, the time of rendering will be pretty small even for big datasets, so the most time consuming part will be row data filtering ( by the dhtmlxgrid experience, I may say, that 5000 records will require a significent amount of time, to be filtered by javascript )
If you plan to use result tree with-in intranet it may have sense to use dyn. loading and reload data from server side, it will be faster than client side filtering for such big datasets. 

>>Do you plan to introduce filter ability to the tree in the future?
We have such plans , but I can't specify any exact time agenda. 
You can contact out sales department ( sales@dhtmlx.com ) , and request custom modification.

Answer posted by michal on Sep 08, 2008 11:57

Thank you very much for your time.

Yes, it will be only used in intranet, and I think I will stick to JSON on server side, generated from cached data to avoid overhead of database queries.

You have great support for great software. It is well worth every cent paid.

Thank you again.