From the JQuery UI docs:
(The
responseevent is) triggered after a search completes, before the menu is shown. Useful for local manipulation of suggestion data.
And
(The
ui.contentargument) contains the response data and can be modified to change the results that will be shown.
Hoewever, if I modify ui.content on the response event it doesn't affect the results shown in the dropdown, instead my code is just ignored. Here's my (test) code:
$('input.autocomplete').autocomplete({
source: new Array({label: 'test1', value: 'test1'}, {label: 'test2', value: 'test2'}),
response: function( event, ui ) {
ui = {content: new Array({label: 'test3', value: 'test3'}, {label: 'test4', value: 'test4'})};
}
});
In theory, if the term is "t", it should display test3 and test4 as my autocomplete options, but it doesn't. I get test1 and test2.
What am I missing?
I'm using version 1.9.2 in case you want to point me to this thread.
Aucun commentaire:
Enregistrer un commentaire