开发者

jQuery UI Autocomplete: Triggering a Search From outside of autocomplete

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜