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.

Custom filter (Excel)

Thread ID:

Created:

Updated:

Platform:

Replies:

130834 Jun 6,2017 09:22 AM Jun 7,2017 06:23 AM Angular 1
loading
Tags: ejGrid
Me
Asked On June 6, 2017 09:22 AM

Hello,

Trying to implement Excel filtering and almost evertyhing works fine apart suggestions in custom filter textfield. My current return format from backend for grid (json) is:
{ result: [{}, {}, {} ..], count: 0 } - I see that by my request, I do return those records, but suggestion list can't find anything. Do I need different return format? If yes, how do I know which format to return when it's for Grid and Suggestions list? When I stop typing in textfield, it makes this request:


Jayaprakash Kamaraj [Syncfusion]
Replied On June 7, 2017 06:23 AM

Hi Customer, 

Thank you for contacting Syncfusion support. 

To overcome this problem, we suggest you to return records alone in server side when dm.RequiresCounts as false for display autocomplete suggestion list. Please refer to the below code example. 


 public ActionResult DataSource(Syncfusion.JavaScript.DataManager dm) 
        { 
            IEnumerable Data = OrderRepository.GetAllRecords(); 
            Syncfusion.JavaScript.DataSources.DataOperations operation = new Syncfusion.JavaScript.DataSources.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); 
                if (!dm.RequiresCounts) 
                    return Json(Data); //Return records alone for the autoComplete list 
            } 
            int count = Data.AsQueryable().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 }, JsonRequestBehavior.AllowGet); 
        } 

Regards, 
 
Jayaprakash K. 


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.

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.

;