Filtering a treegrid on the node and the leaf

I’m currently working with a treegrid and it will hold my relations and their contacts.

but when i search for a contact i can filter them but when i search for a relation i can’t filter since they disappear.

is there a way to filter both of them.



so that i can search on both my relations and my contacts in 1 treegrid.



so

- Test company

- Paul T. (0123) 4567890 paul.t@email.com



searching for test or factory results in


By default filtering affects olny the last level of treegrid.


If the company name is the 1st level of hierarchy, you can try to apply the following method:


grid.setFiltrationLevel(0);


Please, see details in the article dhtmlx.com/docs/products/dhtmlxG … eGrid.html





When i change the filtration level to 0 i can search for the parent nodes.



But then i can’t search for the contacts under it.



I want to be able to search on both.



filtrationlevel -2 doesn’t show me anything at all.



 



If i search for the company i want it to show the company + the contacts



if i search for a contact i want it to show the corresponding contacts + their parent companies.


Unfortunately, it is not possible to achieve both of the requirements using #text_filter in one column.


There are several possible ways that you can use. The examples of two of them:


1) using 2 columns with #text_filter for each of them:


- company (tree),


- contacts


for example:




Test company



Paul T. (0123) 4567890 paul.t@email.com



2) custom filter function (filterBy) instead of #text_filter: dhtmlxGrid/doc/articles/Data_filtering_search.html; here you can compare userdata of the rows (there can be two userdata tags company and contact);




They already were in seperate collumns but somehow when i go for either level -2 -1 0 1 or 2 one of them disappears when i search for the opposite



or they both disappear.



and ofcourse when the parent disappears they both disappear.


Hello,


sorry for the misleading information. Two text_filter also don’t solve the issue.


We have sent you the example of possible custom filtering function by email.

Thanks :slight_smile:

Hi, I’m having the same problem here.
Is there a way that you can post the filtering function here?
I’d appreciate that.


Hello,


please contact us at support@dhtmlx.com to get the sample (this is PRO functionality and requires license).