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.
HERE IS THE MARKUP:
<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
});
container.ejAutocomplete({
dataSource: dm,
query: ej.Query().select("ICD10Code", "Text"),
fields: { key: "ICD10Code", text: "Text" },
filterType: ej.filterType.Contains,
watermarkText: "Search",
actionComplete: function (args) {
console.log('actionComplete');
console.dir(args);
}
});
}
HERE IS THE CONTROLLER ACTION:
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.
Thanks,
Matt