Hey
How do i store a predefined json in a varaible as a source? I am getting a json in document.ready via ajax. I then store it in a variable and use it in the source, but this doesnt work.

charakalmast  -  Mar 03, 2014

and also how do i limit the number of results?

Hawkee  -  Mar 03, 2014

Make sure your json matches the format required for this to work. You can check the jsfiddle for a working example. As far as a limit, there is no functionality for that, but this might help: http://stackoverflow.com/questions/7617373/limit-results-in-jquery-ui-autocomplete

charakalmast  -  Mar 03, 2014

Hey
The link worked for me.. I also figured out that i had to convert the string into a json object using JSON.parse(string) to make the variable work.
Can you also tell me how i can change the thing we search for? i.e. this current searches the label data, can i change it to something else

Hawkee  -  Mar 03, 2014

Why change it to something else?

charakalmast  -  Mar 04, 2014

actually i had implemented the whole autocomplete and used the label as something. i had changed a lot of code. now i want to add another searching factor which i will concat with some other value in the json.

Hawkee  -  Mar 04, 2014

You would have to modify the code to support multiple triggers.

adama36  -  Nov 04, 2015

How to modify it ?

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.