我想实现自动完成http://jqueryui.com/autocomplete/来过滤每一列
在数据表 jquery 插件中。
例如,如果我想在数据表搜索中搜索带有 ED 的嵌入式设备,它不会为我这样做......所以我想显示自动完成,当用户从列表中选择它时,我希望数据表进行过滤。
var oTable = $('#listings_row').dataTable( );
$("thead input").keyup( function (
oTable.fnFilter( this.value, parseInt($(this).attr('id')) );
} );
$("thead input").each( function (i) {
asInitVals[i] = this.value;
} );
$("thead input").focus( function () {
if ( this.className == "search_init" )
{
this.className = "";
this.value = "";
}
} );
$("thead input").blur( function (i) {
if ( this.value == "" )
{
this.className = "search_init";
this.value = asInitVals[$("#listings_row thead input").index(this)];
}
} );
我该怎么做?