我的列过滤器有问题,它显示在数据表的灰色区域和第二行之间。除了没有背景和样式外,它运行正常。
function tablefill(selected) {
$.fn.dataTableExt.sErrMode = 'throw';
$('.advsearchbar').show();
$('#stable').show();
$('#table_id').dataTable({
"sAjaxSource": '/php/connect/searchtablequery.php',
"bProcessing": true,
//"sScrollY": "500px",`
"bAutoWidth": false,
"bDeferRender": true,
"bDestroy": true,
"bFilter": true,
"aaSorting": [[0, 'desc']],
"sAjaxDataProp": "",
"fnServerParams": function (aoData) {
aoData.push({ "name": "db", "value": selected });
},
"aoColumns": [
{"sWidth": "40%","mData": "calldate" },
{"sWidth": "30%","sClass": "system", "sType": "string", "mData": "uniqueid" },
{"sWidth": "150%","sType": "string", "mData": "clid" },
{"sWidth": "10%","sType": "string", "mData": "lastapp" },
{"sWidth": "100%","sType": "string", "mData": "dst" },
{"sWidth": "50%","sType": "string", "mData": "disposition" },
{"sWidth": "5%","sType": "string", "mData": "duration_in_mins_and_secs" }, ],
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sDom": '<"H"lrT>t<"F"ip>',
"oTableTools": {
"sSwfPath": "/DataTables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "text",
"sButtonText": "Refresh",
"sButtonClass": "refresh",
"fnClick": function (nButton, oConfig, oFlash) {
var selected = $('#dblist').find(":selected").text();
tablefill(selected);
}
},
{
"sExtends": "collection",
"sButtonText": "Export",
"aButtons": ["csv", "xls", "pdf"]
}]
}
}).columnFilter({
sPlaceHolder: "head:before",
aoColumns: [
null,
{"type": "text","bRegex": true,"bSmart": true},
{"type": "text","bRegex": true,"bSmart": true},
{"type": "text","bRegex": true,"bSmart": true},
{"type": "text","bRegex": true,"bSmart": true},
{"type": "text","bRegex": true,"bSmart": true},
null
]
});
};
<body>
<div id="stable" style=" margin-left: 2%; margin-right: 2%; display:none;">
<table class="display" id="table_id" style="width: inherit;">
<thead>
<tr>
<th></th>
<th>Unique ID</th>
<th>Source</th>
<th>App</th>
<th>Destination</th>
<th>Disposition</th>
<th></th>
</tr>
<tr>
<th>Call Date</th>
<th>Unique ID</th>
<th>Source</th>
<th>App</th>
<th>Destination</th>
<th>Disposition</th>
<th>Duration</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</body>
这是我在桌子上的 CSS
<link type="text/css" rel="stylesheet" href="/DataTables/media/css/smoothness/jquery-ui-1.10.3.custom.css"/>
<link type="text/css" rel="stylesheet" href="/DataTables/media/css/jquery.dataTables_themeroller.css"/>
<link type="text/css" rel="stylesheet" href="/DataTables/media/css/demo_table_jui.css" />
<link type="text/css" rel="stylesheet" href="/DataTables/extras/TableTools/media/css/TableTools.css" />