On 4/25/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
Jose schrieb: > > You asked how you could implement these features w/out modifying > the source > code, so I tried to provide some solutions. :) > > > Thanks. I just want to make sure my needs are taken into account give > that autocomplete > code is being worked on. Dunno yet how that can be implemented, but usage could like this: var options = { url: "somefile", extraParams: { you: "me" } }; $("input").autocomplete(options); // some time later options.url = "otherfile"; Currently that doesn't work because url is a single parameter (easy to change) and the passed-in options argument is cloned (not hard, but not trivial to change). It may suffice to clone the options as normal, extending the defaults, and using the original argument for url and extraparams. There are no defaults for those anyway.
Maybe one could define a function beforeAuto(url, options) where the user can customize that behavior before each call. In my case, beforeAuto would check the url selected by the user. The options param is useful as well because each data set might need different options anyway. Another situation I want to handle is being able to click on links in the item, e.g. the formatted item is <li> name <a href=examples.cgi>examples</a> <a href=dict.cgi
dictionary</a></li>
where a click triggers the selection but also a.click are triggered as well. This is the case where you're checking info more that doing data entry thanks