如何修改jquery-ui的autocomplete,让它支持参数自定义

1 在$.widget( "ui.autocomplete", {中的options中加入term:'term'

2 在_search: function( value ) {方法中,

this.source({term:value}, this._response())替换成

 

var option = {};
option[this.options.term] = value;
this.source(option, this._response());

 

 

3 然后就可以在页面中.autocomplete({term:'abc'})来传参了

版本是1.11.4

posted @ 2016-05-10 17:52  前门攻城狮  阅读(1098)  评论(0编辑  收藏  举报