Column filtering operator 'contains' not work

https://jsplayground.syncfusion.com/aliiusqt

 filterSettings: {
                  filterType: ej.TreeGrid.FilterType.FilterBar  ,    
                 filteredColumns: [{
                    value: "",
                    field: "taskName",
                    predicate: "and",
                    operator: "contains"
                }]
                }

When I input ‘time’ there is no query record..



1 Reply

JR John Rajaram Syncfusion Team August 21, 2018 08:29 AM UTC

Hi Tmzl 
Thank you for contacting Syncfusion support. 
We have checked your requirement and code snippets. In TreeGrid when we set the value to the filterSettings.filteredColumns property then the TreeGrid is rendered based upon these value at initial load only. But in TreeGrid there is no API support to filter the columns based upon the filter condition when filterType is filterBar, but there is filterColumn public method support to filter the columns based upon the filter condition in TreeGrid. Please find more details about the method here. We can achieve your requirement by using filterColumn public method with work around. Please refer the below code snippet. 
<script type="text/javascript"> 
        $(function () { 
 
            $("#TreeGridContainer").ejTreeGrid({ 
                dataSource: sampleData, 
                childMapping: "subtasks", 
                filterSettings: { 
                    filterBarMode: "onEnter" 
                }, 
                create: function () { 
                      $("#TreeGridContainer_taskName_filterbarcell").bind('keyup', function (e) { 
                        timer = setTimeout(function () { 
                        var text = $("#TreeGridContainer_taskName_filterbarcell").val(); 
                        var treeObject = $("#TreeGridContainer").data("ejTreeGrid"); 
                        treeObject.filterColumn("taskName", "contains", text, "and"); 
                        },100); 
                    }); 
                }, 
                 //.. 
  }) 
        }); 
 
</script> 
We have prepared the sample for your reference, please find the sample link below 
Regards, 
John R 


Loader.
Up arrow icon