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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

The allow-filter is being ignored when my grid data comes from datamanger

Thread ID:

Created:

Updated:

Platform:

Replies:

132405 Aug 30,2017 08:31 PM UTC Aug 31,2017 10:43 AM UTC ASP.NET Core 1
loading
Tags: Grid
dsapo
Asked On August 30, 2017 08:31 PM UTC

Hi Support:

I have an issue with the filtering in a grid whose data comes from a datamanager as follows:

<ej-grid id="grid"
                         allow-filtering="true"
                         allow-scrolling="true"
                         allow-selection="false"
                         allow-paging="true"
                         is-responsive="false">
                    <e-datamanager url="/Order/Datasource" adaptor="UrlAdaptor" />
                    <e-columns>

The filter icons are being displayed, but when you set a filter, it is ignored.

Any ideas.

Thanks

David


Mani Sankar Durai [Syncfusion]
Replied On August 31, 2017 10:43 AM UTC

Hi David. 
 
 
Thanks for contacting Syncfusion support. 
 
 
 We have analyzed your and we suspect that you would like to perform Filtering operation when using UrlAdaptor in grid. When using the UrlAdaptor we suggest you to perform server side operation in grid when performing sorting, filtering, paging, grouping etc.., 
 
Refer the code example. 
<ej-grid id="FlatGrid" allow-paging="true" allow-filtering="true" > 
    <e-filter-settings filter-type="Excel"></e-filter-settings> 
   <e-datamanager url="/Home/DataSource" adaptor="UrlAdaptor"></e-datamanager> 
      <e-columns> 
        <e-column field="OrderID" header-text="Order ID" is-primary-key="true" text-align="Right" width="75"></e-column> 
         <e-column field="CustomerID" header-text="Customer ID"  width="75"></e-column> 
          <e-column field="ShipCity" header-text="Ship City" width="75"></e-column> 
      </e-columns> 
</ej-grid> 
 
In the server side we can get it from the DataManager Class which contains the object for every grid actions like filtering, sorting, grouping, skip and take (i.e paging) etc..,  

Refer the code example. 
[HomeController.cs] 
public ActionResult DataSource([FromBody]DataManager dm)//Using DataManager class which contains Sorting, filtering as a parameter.   
        {….    } 
 
Please refer the below code example which contains server side operations. Using DataOperations class each actions in grid takes place. 

using Syncfusion.JavaScript.DataSources; 
using Syncfusion.Linq; 
using Syncfusion.JavaScript.Models; 
  public ActionResult DataSource([FromBody]DataManager dm) 
        { 
            IEnumerable data = orddata; 
            DataOperations operation = new DataOperations(); 
            if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting 
            { 
                data = operation.PerformSorting(data, dm.Sorted); 
            } 
            if (dm.Where != null && dm.Where.Count > 0) //Filtering 
            { 
                data = operation.PerformWhereFilter(data, dm.Where, dm.Where[0].Operator); 
            } 
            int count = data.Cast<Orders>().Count(); 
            if (dm.Skip != 0) 
            { 
                data = operation.PerformSkip(data, dm.Skip); 
            } 
            if (dm.Take != 0) 
            { 
                data = operation.PerformTake(data, dm.Take); 
            } 
            return Json(new { result = data, count = count }); 
 
        } 
 
 
 
Refer the KB link of how to perform server side grid actions 
 
We have also prepared a sample that can be downloaded from the below link. 

If you still face the issue please share us the following details, 

1.       Share the screenshot/ video of the issue that you have faced. 
2.       Share the controller page. 
3.       Share the hosted site. 
4.       If possible please reproduce the issue in the above attached sample. 

The provided information will help us to analyze the issue and provide you the response as early as possible  


Please let us know if you need further assistance, 


Regards, 
Manisankar Durai. 




CONFIRMATION

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.

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

;