I’ve got a remote source which does not return id and value or label. How can I use it as a source for jquery’s autocomplete plugin?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should pass
sourcea function that makes the AJAX request manually, and then performs some post-processing on the returned data:Basically, use
$.mapto turn the array you get back into an array of objects that the autocomplete widget supports.For a working example, check out the JSONP example on jQueryUI’s demo page.