Setting Fields on autocomplete in angularjs

Hello, 

I am trying to set the fields that autocomplete should search through in the data source. The data source looks like this:

[{ name: "Peter", Address: "34 Driving Drive"},
 {name: "Mary", Address: "2 Walking Drive"}]

and my element looks like this:

  <input type="text" class="ejinputtext form-control" ej-autocomplete e-datasource="customerList" e-mincharacter="3" e-fields='{key:"name", text:"name"}' />

This doesn't work thou, am I doing it correctly?



1 Reply

HP Harikrishnan P Syncfusion Team August 20, 2015 12:13 PM UTC

Hi Garwin,

Thanks for using Syncfusion products.

While specifying the values for the attributes of “fields” API, you need to specify as shown below,


<input type="text" ej-autocomplete  e-datasource="dataList" e-fields-key="name" e-fields-text="name"  />


Based on your code we have showcased an example sample in the following link, please check it.

http://jsplayground.syncfusion.com/by3dr0ky

You can refer the following link to know more about the Angular support in our JS components

http://helpjs.syncfusion.com/js/angularjs


Also you can refer the angular samples of all components from the following location

http://js.syncfusion.com/demos/web/#!/azure/angularsupport

You can refer the getting started and API reference of all components from the following link

http://docs.syncfusion.com/js/overview
Please let us know if you have further queries.


Regards,
HariKrishnan

Loader.
Up arrow icon