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

Autocomplete with Remote Datasource

Thread ID:





128534 Jan 26,2017 07:54 PM UTC Jan 30,2017 06:52 AM UTC JavaScript 4
Tags: ejAutoCompleteTextBox
Matt Abercrombie
Asked On January 26, 2017 07:54 PM UTC

I have an autocomplete configured with a remote data source, which is calling and returning an array of data. However, the suggestion drop down does not appear. 

    <input type="text" class="icd-code-search-box" />

HERE IS THE JAVASCRIPT (the container object is a reference to the input above):

function configureICD10CodeSearch(container) {
    var dm = ej.DataManager({
        url: '/CommonDataControls/SearchICD',
        adaptor: new ej.UrlAdaptor

        dataSource: dm,
        query: ej.Query().select("ICD10Code", "Text"),
        fields: { key: "ICD10Code", text: "Text" },
        filterType: ej.filterType.Contains,
        watermarkText: "Search",
        actionComplete: function (args) {

        public ActionResult SearchICD(DataManager dm)
            DataManagerOperationResults results;

            results = PerformDataManagerOperations(PatientProblemsModels.SearchICD(), dm);

            return Json(new
                ICD10CodeSearchResults = results.Data
            }, JsonRequestBehavior.AllowGet);

When I inspect the args of the "actionComplete" event, the "result" contains the array "ICD10CodeSearchResults". The data in the array has fields "ICD10Code" and "Text". I am not sure how to set the configuration in order to have the suggestions bound correctly. Please advise.


Arun Palaniyandi [Syncfusion]
Replied On January 27, 2017 10:54 AM UTC

Hi Matt,   
Thanks for contacting Syncfusion Support.   
We have tried to reproduce the corresponding issue by using shared code snippet and we were able to reproduce the issue. After checking the code, we found that you have passed the Json data in the controller through another object. Hence, the result data will be stored as the object type and the suggestion list is not generating. So, you have to return the Json data directly without any object.   
public ActionResult SearchICD(Syncfusion.JavaScript.DataManagerdm)   
            return Json(Data, JsonRequestBehavior.AllowGet);   

We have also prepared a sample for your reference in the  below location.   
If this isn’t your scenario, please modify the sample based on your application for us to reproduce the issue, and help us to find the solution. 

Arun P.   

Matt Abercrombie
Replied On January 27, 2017 01:29 PM UTC

The sample link does not appear to be working.

Matt Abercrombie
Replied On January 27, 2017 02:02 PM UTC

The proposed solution worked perfectly. Thank you very much for the assistance and prompt response.

Ezhil S [Syncfusion]
Replied On January 30, 2017 06:52 AM UTC

Hi Matt, 

Thanks for the update. 

We are glad the suggestion helped you to resolve the issue. 

Please let us know if you need further assistance. 
Ezhil S 


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

or the page will be automatically redirected to 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