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

Include group in ejDropDownList filter search

Hi,

When enabling filter search, is there a way to have the search include the grouped by field?

3 Replies

PO Prince Oliver Syncfusion Team February 1, 2019 12:23 PM UTC

Hi Malcolm, 

Thank you for contacting Syncfusion support. 

To enable the grouped by field included in the DropDownList filtering, we need to modify the search query in the search event to include the category field. Kindly refer to the following code snippet. 
  
<script> 
    $('#vegetable').ejDropDownList({ 
        width: "100%", 
        watermarkText: "Select a vegetable", 
        dataSource: skillset, 
        fields: { text: "skill", category: "category" }, 
        allowGrouping: true, 
        enableFilterSearch: true, 
        search: function (args) { 
            args.searchQuery = ej.Query().where(ej.Predicate(this.model.fields.text, this.model.filterType, this._queryString, true).or(this.model.fields.category, this.model.filterType, this._queryString, true)); 
        } 
    }); 
</script> 

We have attached a sample for your reference, please find the sample at the following location: https://jsplayground.syncfusion.com/dsnbc50l  

Please let us know if you need any further assistance on this. 

Regards, 
Prince 



MV Malcolm van Staden February 1, 2019 02:38 PM UTC

Excellent. That works great. Thank you for the solution.


PO Prince Oliver Syncfusion Team February 4, 2019 04:57 AM UTC

Hi Malcolm, 

Most welcome. We are glad to help you. Please let us know if you need any further assistance on this. 

Regards, 
Prince 


Loader.
Live Chat Icon For mobile
Up arrow icon