我使用数据表和列过滤器插件来显示和过滤数据库中的数据。我实现了多选过滤复选框。我所能做的就是为复选框过滤器预定义值,但我需要复选框过滤器来自数据库的值。
jQuery('#tabela').dataTable({
"oLanguage": {
"sSearch": "Search:",
"sInfoFiltered": ''
},
"bProcessing": true,
"bServerSide": true,
"sServerMethod": "GET",
"sAjaxSource": "server.php",
"fnServerParams": function(aoData) {
aoData.push({"name" : "more_data",
"value" : "my_value"})
},
"bJQueryUI": true
}).columnFilter({
aoColumns: [
{ type: "checkbox",
values: ["Filter Cola 1",
"FIlter Cola 2", "FIlter Cola 3"]},
{},
{ type: "checkbox",
values: ["Filter Colc 1",
"FIlter Colc 2","FIlter Colc 3"]}
]
});
如何从服务器端设置复选框过滤器值?