Filtering column by multiple words

Hi,

I'm implementing  a filtering system formed by a dropdownlist with checkboxes. Depending in the selected options we have to filter the only column in the gantt.
I'm triying with "filterColumn" but I don't know how to use it to filter by the multiple options selected in the dropbox list.

For example:

This:


Must filter like this:


Thanks


3 Replies

JR John Rajaram Syncfusion Team September 4, 2018 01:56 PM UTC

Hi Oscar, 
Thank you for contacting Syncfusion support. 
In Resourceview Gantt we can achieve your requirement by using filterContent public method with work around. Please refer the below code snippet for more information. 
<div id="dropdown"> 
        <input type="text" id="resouceColumn" /> 
 </div> 
<ej-gantt id="resourceGantt" 
    (create)="create($event)" 
          //.. 
        > 
</ej-gantt> 
 
[TS] 
     create(args) { 
        var obj = $("#resourceGantt").ejGantt("instance"); 
        var data = obj.model.resources; 
        $('#resouceColumn').ejDropDownList({ 
            dataSource: data, 
            beforePopupHide: function (args) { 
               var obj = $("#resourceGantt").ejGantt("instance"); 
                var value = args.text.split(','); 
                var predicate; 
                if (value) { 
                    for (var i = 0; i < value.length; i++) { 
                        if (predicate) { 
                            predicate = predicate.or("eResourceName", ej.FilterOperators.equal, value[i], false); 
                        } else { 
                            predicate = new ej.Predicate("eResourceName", ej.FilterOperators.equal, value[i], false); 
                        } 
                    } 
                    obj.clearFilter(); 
                    obj.filterContent(predicate); 
                } else { 
                    obj.clearFilter(); 
                } 
            }, 
            fields: { text: "resourceName" }, 
            watermarkText: "Select the resources", 
            showCheckbox: true, 
            width: 150 
        }); 
 
    } 
 
We have prepared the sample for your reference, please find the sample from below link 
Please let us know if you require further assistance on this. 
Regards, 
John R 



OB oscar bartolome September 4, 2018 02:21 PM UTC

Ok, that works great. Thanks!


JR John Rajaram Syncfusion Team September 5, 2018 04:22 AM UTC

Hi Oscar, 
Thanks for the update. Please let us know if you need further assistance on this. 
Regards, 
John R 


Loader.
Up arrow icon