cloumfilter在服务器端预处理中无法处理jquery数据表
cloumnfilter not working jquery datatables in serverside preprocessing
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>
看起来你的身体在thead
和tfoot
:之间
<tbody>
<tr>
<td>Name</td>
<td>Position</td>
<td>Office</td>
<td>Extn.</td>
</tr>
</tbody>
似乎没有正确传递sSource值。sSource基本上是DataTables.js中的"ajax"url值。我的解决方案是从columnFilter.js文件第796行的DataTable ajax值中重新添加sSource:
sSource = sSource ? sSource : oTable.fnSettings().ajax;
所以它看起来像:
oTable.fnSettings().fnServerData = function (sSource, aoData, fnCallback) {
sSource = sSource ? sSource : oTable.fnSettings().ajax;
....
}
相关文章:
- Don'在追加后,我无法处理jQuery代码
- 在iOS上处理jQuery Mobile点击事件后,阻止点击事件
- 是否有任何方法可以像处理jQuery中附加到XHR延迟对象的done方法处理程序一样处理websocket onmess
- 处理jQuery提交表单的两种方法
- 如何处理 jQuery 中的数字输入更改
- Chrome 不处理 jquery ajax 查询
- 我如何处理 jQuery 中锚点的文本值更改为“”的情况
- Internet Explorer 11 根据开发人员工具是否打开而以不同的方式处理 jQuery
- 处理 jQuery 小部件关闭方法
- 悬停时对表格背景进行动画处理 - Jquery.
- 如何处理 jquery 数据表中的数据库空值
- 处理 jQuery 事件时在 JavaScript 类中覆盖的 'this' 关键字
- 在不同的对象上应用相同的 id 并分别对它们进行动画处理 (jQuery)
- 使用 jQuery 延迟对象以串行方式处理 jQuery 集合/数组
- 拦截和预处理 jQuery-ui 自动完成数据
- 在字符串上处理 jQuery/Sizzle 查询
- 如何按照请求的顺序处理 jquery ajax 请求
- 处理 jQuery deferred.done 被调用,即使请求被中止
- 使用Google闭包编译器处理jQuery parseHTML()和html(),,,
- 请帮我处理jQuery.post.我的脚本没有给出错误,也没有发布表单字段