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

how to clear history in filter bar

Hi There,
I have ejgrid with filter type = "filterbar".
I wounder how to clear the history that users have entered (in the red box below)?
Thanks in advance for help.
$(function () {
$("#Grid").ejGrid({
dataSource: Data,
allowPaging: true,
allowSorting: true,
allowFiltering: true,
filterSettings:{filterType:"filterbar", filterBarMode: ej.Grid.FilterBarMode.OnEnter},
columns: [
{ field: "OrderID", headerText: "Order ID", textAlign: ej.TextAlign.Right, width: 90 },
{ field: "OrderDate",type:"date", headerText: "Order Date", width: 200, format:"{0:dd-MMM-yyyy}"},
{ field: "CustomerID", headerText: "Customer ID", width: 100 },
{ field: "EmployeeID", type:"number",headerText: "Employee ID", textAlign: ej.TextAlign.Right, width: 100 },
],
//actionBegin:"actionBegin",
});
});

2 Replies

ED Erik D replied to Erik D April 11, 2019 12:28 PM UTC

Hi There,
I have ejgrid with filter type = "filterbar".
I wounder how to clear the history that users have entered (in the red box below)?
Thanks in advance for help.
$(function () {
$("#Grid").ejGrid({
dataSource: Data,
allowPaging: true,
allowSorting: true,
allowFiltering: true,
filterSettings:{filterType:"filterbar", filterBarMode: ej.Grid.FilterBarMode.OnEnter},
columns: [
{ field: "OrderID", headerText: "Order ID", textAlign: ej.TextAlign.Right, width: 90 },
{ field: "OrderDate",type:"date", headerText: "Order Date", width: 200, format:"{0:dd-MMM-yyyy}"},
{ field: "CustomerID", headerText: "Customer ID", width: 100 },
{ field: "EmployeeID", type:"number",headerText: "Employee ID", textAlign: ej.TextAlign.Right, width: 100 },
],
//actionBegin:"actionBegin",
});
});

I have a solution for that. I hope it could help some one who is looking for similar solution.

$(function () {
            $("#Grid").ejGrid({
                dataSource: Data,
allowPaging: true,
          allowSorting: true,
allowFiltering: true,
filterSettings:{filterType:"filterbar", filterBarMode: ej.Grid.FilterBarMode.OnEnter},
              
                columns: [
                                       
                ],
        create: "disableAutoComplete",


            });
        });


function disableAutoComplete(args) {
    var i = 0, j = 0;
    var len = this.model.columns.length,
        columns = this.model.columns;
    for (i = 0; i < len; i++) {
        $("#" + columns[i].field + "_filterBarcell").attr("autocomplete", "off"); 
        $("#" + columns[i].field + "_filterBarcell.e-ejinputtext.e-filtertext").attr("autocomplete", "off");
    }
}


VN Vignesh Natarajan Syncfusion Team April 12, 2019 05:55 AM UTC

Hi Erik,  
 
Thanks for contacting Syncfusion forums. 
 
Query: “I have a solution for that. I hope it could help some one who is looking for similar solution. 
 
Thanks for your suggestion. We are glad to know that you query has been resolved. Instead of create event, you can even use dataBound event to achieve your requirement.  
 
Please get back to us if you have further queries.   
 
Regards 
Vignesh Natarajan. 


Loader.
Up arrow icon