I don't have a solution, but I have a "guess" on where the
problem is inside the plugin.
After some research, its not really just extraParams, but
options in general seem to require some extra work for dynamic
Looking at extraParams, this option is binded only once within
this code block of the plugin:
so when you dynamically change opts.extraParams, somehow we need
to get the binding to run again so that the private method
keyChange() will run and initialize the getJSON call with the new
How can we achive this?
For similiar issues, I see others working around this by using
understand this concept and I need to do more research on
approaches such as this:
I have a "workaround". Sorry this is not elegant but it will
work. It requires that you:
A. use the asHtmlID option.
B. call the autocomplete plugin each time you change the option's
My approach involves using html5's data attribute (for some
reason I had issues using jQuery's $.data wrapper) and the approach
is to attach extraParams to the input element of the plugin and to
keep it updated in the following way:
First find the if statement and add the following
Change the getJSON call to use the html5 data attribute instead
of the options extraParams: $.getJSON(req_string+"?"+opts.queryParam+"="+encodeURIComponent(string)+limit+$('#'
I don't understand why the original opts.extraParams is locked
on the value it was assigned the first time autosuggest was called,
and does not use the new values after changing them, hence my html5
data workaround. I'm open to a better solution, but for now I'll
have to use this one.