单个列过滤器在Datatable中不起作用

时间:2016-04-06 12:36:59

标签: javascript jquery datatables

我正在使用jQuery DataTables @version 1.10.11

一切正常,但列过滤器无法正常工作。问题是什么?

是否需要外部插件或文件?

请帮忙。



workspace->project_name->
                        bin/com/unisys/connections/ODBCConnection.class
                        bin/com/unisys/sql/CasePartitionExtractor.class
                        manifest.txt
                        rt.jar

$(document).ready(function(){
	$('#clist').dataTable({
        "ordering": true,
		"searching": false,
		"order": [[ 0, "asc" ]],
		"dom": 'rt<"bottom"lip>',
		"columnDefs": [
			{
				"targets": [ 0 ],
				"visible": false,
			}, {
				"targets": [ 2 ],
				"orderable": false,
			}, {
				"targets": [ 3 ],
				"orderable": false,
			}, {
				"targets": [ 4 ],
				"orderable": false,
			}
        ]
    })
	.columnFilter({
		//sPlaceHolder: "head:after",
		aoColumns: [
				{ type: "text" },
				{ type: "select", values: [ 'val1', 'val2', 'val3', 'val4']  },
				{ type: "select", values: [ 'val1', 'val2', 'val3', 'val4']  },
				null
		]

	});
});
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

您需要为columnFilter插件添加jquery.dataTables.columnFilter.js,请参阅Downloads页。

请参阅this jsFiddle以获取代码和演示。