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

Remote data filtering, autcomplete issue

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


5 Replies

PS Pavithra Subramaniyam Syncfusion Team 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.  



JP Jonathan Payet 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


PS Pavithra Subramaniyam Syncfusion Team 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. 



JP Jonathan Payet 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.


PS Pavithra Subramaniyam Syncfusion Team 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. 


Loader.
Live Chat Icon For mobile
Up arrow icon