开发者

jQuery UI Autocomplete: Triggering a Search From outside of autocomplete

开发者 https://www.devze.com 2023-01-30 06:41 出处:网络
I would like to trigger some jQuery autocomplete events from outside of auto开发者_如何学Pythoncomplete but I don\'t know how to. i.e.

I would like to trigger some jQuery autocomplete events from outside of auto开发者_如何学Pythoncomplete but I don't know how to. i.e.

$("something").autocomplete({select:function(event,ui){do x},
                                search:function(event,ui){do y}});

$("something else").keypress(function(eventobject){*trigger autocomplete "select"*});

What code do I put in trigger autocomplete "select"


Use the "Search" method: http://api.jqueryui.com/autocomplete/#method-search

$("something").autocomplete(/* options */);
$("somethingelse").click(function () {
    $("something").autocomplete('search', 'demo-value');
});
0

精彩评论

暂无评论...
验证码 换一张
取 消