We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

About TreeGrid Filter Operators

Hi,


Is it possible to change the default filter bar operator?
I tried referring to the following URL, but TreeGrid seems to be different.
https://ej2.syncfusion.com/documentation/grid/filtering/#change-default-filterbar-operator

(Source code I tried)
function dataBound(args) {
    var grid = document.getElementById("TreeGrid").ej2_instances[0];
    Object.assign(grid.filterModule.filterOperators, { startsWith: 'contains' });
}


Regards,
Pylori.


3 Replies

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team April 5, 2019 03:47 AM

Hi Pylori, 

Thanks for contacting Syncfusion Support. 

QUERY : Unable to change TreeGrid default Filter Operator 
 
From your query we understand that, you are unable to change the default filter bar operator of treegrid. TreeGrid is built over the Grid Component. We can get the Grid instance from TreeGrid. So we can achieve your requirement by accessing Grid property from TreeGrid like below code example:- 

function dataBound(args) { 
    var treegrid = document.getElementById("TreeGrid").ej2_instances[0]; 
    Object.assign(treegrid.grid.filterModule.filterOperators, { startsWith: 'contains' }); 

Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T 



PY Pylori April 5, 2019 05:11 AM

Hi,


I always appreciate your prompt response.
I was able to achieve the requirements.


Regards,
Pylori.


VN Vignesh Natarajan Syncfusion Team April 7, 2019 08:50 PM

Hi Pylori,  

Thanks for the update.  

We are glad to know that your query has been resolved by our solution.  

Please get back to us if you have further queries. 

Regards, 
Vignesh Natarajan 


Loader.
Live Chat Icon For mobile
Up arrow icon