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

Remote data filtering, autcomplete issue

Thread ID:

Created:

Updated:

Platform:

Replies:

147513 Sep 13,2019 12:02 PM UTC Sep 19,2019 07:24 AM UTC React - EJ 2 5
loading
Tags: Grid
Jonathan Payet
Asked On September 13, 2019 12:13 PM UTC

Hi, 

I have some issues when I want to use the filtering with remote data. 

Here is a working example in local : 


But when I use it with the remote data :

The autocomplete should display Reims AND  Rio de Janeiro... (But it only displays one element)
My server response is : ["Reims","Rio de janeiro"] 
Is it the correct response for the autocomplete ? I can't find any example. 
Can you help ?

Best regards,
JP


Pavithra Subramaniyam [Syncfusion]
Replied On September 17, 2019 09:31 AM UTC

Hi Jonathan, 

Thanks for contacting us. 

We have tried to reproduce the issue but unable to reproduce the issue at our end. Please find the below sample for your reference. 


Could you please share the below details that will be helpful for  better understanding and provide an appropriate solution as early as possible. 

  1. Share the Full Grid code example
  2. Share the Syncfusion version
  3. Share the screenshot of network tab with response
 
Regards, 
Pavithra S.  


Jonathan Payet
Replied On September 17, 2019 10:34 AM UTC

Hi Pavithra,

Thanks for your quick answer.

1) Currently my code is very similar to what you have provided here: https://stackblitz.com/edit/react-147513?file=index.js 
With the difference that I use an UrlAdaptator (Can you update the link : https://js.syncfusion.com/demos/ejServices/Wcf/Northwind.svc/Orders/ for this to work with UrlAdaptator and then i will be able to share my code) 

2) Here is my syncfusion dependencies : 
"@syncfusion/ej2-react-buttons": "^17.2.35",
"@syncfusion/ej2-react-schedule": "^17.2.41",
"@syncfusion/ej2-react-grids": "17.2.47",
"@syncfusion/ej2-react-splitbuttons": "17.2.47",
3) My server response when i start typing "r" in the AutoComplete input :
 

Regards,
JP

Pavithra Subramaniyam [Syncfusion]
Replied On September 18, 2019 09:12 AM UTC

Hi Jonathan, 
 
Thanks for sharing the details. 
 
For Menu filtering Autocomplete component, you need to return the response with whole data object. In your sample you are returning only the array of distinct strings which is the cause of reported issue. So we suggest you to send the distinct data objects instead of particular strings. Please refer to the below code example and screenshot for more information. 
 
[controller.cs] 
public IActionResult UrlDatasource([FromBody]DataManagerRequest dm) 
        { 
            IEnumerable DataSource = orddata; 
            DataOperations operation = new DataOperations(); 
            if (dm.Where != null && dm.Where.Count > 0) //Filtering 
            { 
                DataSource = operation.PerformFiltering(DataSource, dm.Where, dm.Where[0].Operator); 
            } 
            int count = DataSource.Cast<OrdersDetails>().Count(); 
            .   .   . 
            return dm.RequiresCounts ? Json(new { result = DataSource, count = count }) : Json(DataSource); //we have sent all matched records here. However you can send distinct records 
        } 
 
 
 
 
 
 
Please g et back to us if you need any further assistance on this. 
 
Regards, 
Pavithra S. 


Jonathan Payet
Replied On September 18, 2019 10:52 AM UTC

Hi Pavithra,

Thanks it works when I return the response with whole data object. But not at 100%.

If i have a field from a nested object it still didn't work (only one record as above)


For example :  
{
     "customer_id": 1
     "informations": {
          "full_name": "John Doe",
          "age": 18
      }
}

my column directive will be like that : 

<ColumnDirective
headerText={"Full name"}
field={"informations.full_name"}
/>
And now it's only in this case that the AutoComplete does not work properly.

Pavithra Subramaniyam [Syncfusion]
Replied On September 19, 2019 07:24 AM UTC

Hi Jonathan, 
 
Thanks for sharing the details. 
 
We have considered “AutoComplete does not show records properly in filter menu while using complex data binding” as a bug and logged a report for the same. We will include the fix in our October first week patch release.  
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link:  
 
 
Regards, 
Pavithra S. 


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.

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

Live Chat Icon For mobile
Live Chat Icon