将jQuery自动完成搜索方法值传递给搜索事件

时间:2010-08-19 04:33:13

标签: jquery jquery-ui autocomplete

我正在调用搜索方法并传递值

$('myelem').autocomplete('search','test');

然后我有一个搜索事件的事件处理程序

search: function (event,ui){

//I need to access the value 'test' passed from the search method in the search event

}

到目前为止,我无法找到如何访问搜索事件处理程序中的值。该值在source: function (request, response)属性中的request.term事件处理程序中可用。

1 个答案:

答案 0 :(得分:1)

文档内容如下:

search: function(event, ui) { ... }

但是,ui参数原来是一个空对象。