【发布时间】:2014-09-17 06:29:23
【问题描述】:
Columanfilter 在服务器端预处理的数据表中不起作用。带有列搜索的数据表不起作用。下面的代码是示例代码。请在 jsdiddle 或其他任何地方提供。请帮我。 这是javascript代码
$(document).ready(function() {
drawDataTable = function()
{
$('#example').dataTable( {
"processing": true,
"serverSide": true,
"ajax": "../server_side/scripts/server_processing.php",
"sPagination": "full_numbers",
"bFilter": true,
"oSearch":{
"sSearch":"",
"bRegex": false,
"bSmart": true },
"aoColumns":[
{"bSearchable": true},
null,
null,
null
]
})
.columnFilter({
aoColumns: [{
type: "text"
}, {
type: "text"
}, {
type: "text"
},{
type: "text"
}]
});
}
drawDataTable();
} );
这是HTML代码
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
</tr>
</tfoot>
</table>
【问题讨论】:
标签: javascript php jquery ajax jquery-datatables