jquery - triggeredAutocomplete search event -
i've problem triggeredautocomplete script i've found in page: http://www.hawkee.com/snippet/9391/
i've written script:
$(function() { $("#ead_post_home").triggeredautocomplete({ source: "add_user.php", search: function(event, ui) {$('#tri_autocomplete_div ul').empty();}, trigger: "@" }) .data("triggeredautocomplete")._renderitem = function(ul, item) { return $("<li class='autocomplete_li'></li>") .data("item.autocomplete", item) .append(item.id) .appendto($('#tri_autocomplete_div ul')); }; $("#ead_post_home").triggeredautocomplete({ close: function(event, ui) {$('#tri_autocomplete_div ul').empty();$("#tri_autocomplete_div").css("display", "none");} }); });
but search event delete suggestion doesn't work. can me?
maybe try using appendto
option have autocomplete widget handle you.
then can try code:
$(function() { $("#ead_post_home").triggeredautocomplete({ source: "add_user.php", search: function(event, ui) { $('.ui-autocomplete').empty(); }, close: function(event, ui) { $('.ui-autocomplete').empty(); $("#tri_autocomplete_div").hide(); }, appendto: '#tri_autocomplete_div', trigger: "@" }) .data("triggeredautocomplete")._renderitem = function(ul, item) { return $("<li class='autocomplete_li'></li>") .data("item.autocomplete", item) .append( item.id ) .appendto( ul ); }; });
Comments
Post a Comment