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

Method selectValueByKey() issue in ejAutocomplete with web api adaptor and mutiSelectionMode

We use ejAutocomplete with web api adaptor and mutiSelectionMode .  The Web API will fetch data from SQL server database. Basically it works except method selectValueByKey(). For example, we want  ejAutocomplete to display  multiple selections based on several keys (20,21),  we call  $('#' + controlID).ejAutocomplete("selectValueByKey", keys). However, it failed to work, ejTextbox was empty.

Could you please explain how to use method  selectValueByKey() or give example with above scenario?



3 Replies

AP Arun Palaniyandi Syncfusion Team February 15, 2017 05:36 PM UTC

Hi Jim , 
Thanks for contacting Syncfusion support. 
We have analyzed the reported query and the selectValueByKey method will not work with Web API adaptor. Because data will be bound to it only on search operation, so key value will not be available to set text. If you need to selectValueByKey using Web API then corresponding filtering must be done in API method. We have also created a simple service and then given a sample for your convenience below. This will bind Web API data to Autocomplete. 
If the provided sample does not meet your requirement, please get back to us with more information that will help us to provide the solution at earliest.  
Arun P. 

JZ Jason Zhu February 23, 2017 01:33 PM UTC

Thank you. It helps a lot!


AP Arun Palaniyandi Syncfusion Team February 24, 2017 12:08 PM UTC

Hi Jim, 
We are glad to hear your issue has resolved and you are most Welcomed. 
Please let us know if you have any queries in future. 
Arun P. 

Live Chat Icon For mobile
Up arrow icon