Sunday 15 March 2015

javascript - Where does jquery UI Autocomplete store the ui.conent -



javascript - Where does jquery UI Autocomplete store the ui.conent -

when menu open access ui.content array can't find in object anywhere.

i can find menu code doesn't have elements passed ui.content.

$(selector).data("ui-autocomplete").menu.element[0]

any suggestions. i'd add together items menu after menu has opened.

edit

my question equivalent of ui.content stored when menu open?

from jquery ui doc:

response( event, ui ) type: autocompleteresponse

triggered after search completes, before menu shown. useful local manipulation of suggestion data, custom source alternative callback not required. event triggered when search completes, if menu not shown because there no results or autocomplete disabled.

event type: event

ui type: object

ui.content type: array

contains response info , can modified alter results shown. info normalized, if modify data, create sure include both value , label properties each item. code examples: initialize autocomplete response callback specified:

$( ".selector" ).autocomplete({ response: function( event, ui ) {} });

bind event listener autocompleteresponse event:

$( ".selector" ).on( "autocompleteresponse", function( event, ui ) {} );

so can hold of ui.content in phone call handlers. have @ jquery ui autocomplete api.

javascript jquery jquery-ui jquery-ui-autocomplete

No comments:

Post a Comment