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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I apply a filter on a grid using javascript?

Thread ID:





118306 Feb 24,2015 12:01 AM UTC Feb 24,2015 12:39 PM UTC ASP.NET MVC 1
Tags: Grid
Christine Romano
Asked On February 24, 2015 12:01 AM UTC

I am creating the following grid.



.FilterSettings(filter => { filter.ShowFilterBarStatus().StatusBarWidth(500).FilterType(FilterType.Excel).FilterBarMode(FilterBarMode

.Immediate); })

.Columns(col =>






And I want to filter (based on an event). How would I filter on my grid data to display only the data that has aas@as.com in the Email field? 

function applyFilter(filterValue) {

var stringValue = filterValue == "All" ? "" : filterValue;

var gridObj = $("#MerchantsGrid").ejGrid("instance");

var filteredActiveData = ej.DataManager(gridObj).executeLocal(ej.Query().where("Email", ej.FilterOperators.contains, "aas@as.com", false));



Madhu Sudhanan P [Syncfusion]
Replied On February 24, 2015 12:39 PM UTC

Hi Christine,

Thanks for using Syncfusion products.

We have analyzed the provided code snippet and suspect that you have passed the grid object directly to the ej.DataManager (“ as ej.DataManager(gridObj).”) instead of passing the grid datasource and hence the data was not filtered correctly.

We can filter the Email field with value “aas@as.com” from grid datasource as follows.

function applyFilter(filterValue) {

var stringValue = filterValue == "All" ? "" : filterValue;

var gridObj = $("#MerchantsGrid").ejGrid("instance");

var filteredActiveData = ej.DataManager(gridObj.model.dataSource).executeLocal(ej.Query().where("Email", ej.FilterOperators.contains, "aas@as.com", false));


Now in the above highlighted section, you can see that we have passed the grid datasource to ej.DataManager and now filteredActiveData will contain the filtered value.

If you want to display the filtered value in grid, then we can do as follows.


For more information on performing custom or external filtering in grid, please refer the below link (Refer the External filter section in the below link).


Please let us know if you have any queries.


Madhu Sudhanan. P


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon