gpt4 book ai didi

jquery数据表列过滤器问题?

转载 作者:行者123 更新时间:2023-12-01 01:36:06 24 4
gpt4 key购买 nike

我正在使用jquery数据表插件。这个数据表插件再次使用另一个名为数据表列过滤器的插件。

这是列过滤器的链接

http://jquery-datatables-column-filter.googlecode.com/svn/trunk/index.html

问题:

这里创建数据网格没有问题。但不会创建列过滤器。

enter image description here

enter code here
<!doctype html>
<html>
<head>
<title>jQuery datagrid</title>

<script src="js/jquery.js"></script>
<script src="js/jquery.dataTables.js"></script>
<script src="js/jquery.dataTables.columnFilter.js"></script>

<style type="text/css" title="currentStyle">
@import "css/jquery.dataTables.css";
</style>
</head>
<body>
<script>
// init code

$(document).ready(function(){
//create datatable
$('#example2').dataTable({
bJQueryUI: true,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "sTitle": "Engine" },
{ "sTitle": "Browser" },
{ "sTitle": "Platform" },
{ "sTitle": "Version", "sClass": "center" },
{ "sTitle": "Grade", "sClass": "center" },],
"aaData": [
/* Reduced data set */
[ "Trident", "Internet Explorer 4.0", "Win 95+", 4, "X" ],
[ "Trident", "Internet Explorer 5.0", "Win 95+", 5, "C" ],
[ "Trident", "Internet Explorer 5.5", "Win 95+", 5.5, "A" ],
[ "Trident", "Internet Explorer 6.0", "Win 98+", 6, "A" ],
[ "Trident", "Internet Explorer 7.0", "Win XP SP2+", 7, "A" ],
[ "Gecko", "Firefox 1.5", "Win 98+ / OSX.2+", 1.8, "A" ],
[ "Gecko", "Firefox 2", "Win 98+ / OSX.2+", 1.8, "A" ],
[ "Gecko", "Firefox 3", "Win 2k+ / OSX.3+", 1.9, "A" ],
[ "Webkit", "Safari 1.2", "OSX.3", 125.5, "A" ],
[ "Webkit", "Safari 1.3", "OSX.3", 312.8, "A" ],
[ "Webkit", "Safari 2.0", "OSX.4+", 419.3, "A" ],
[ "Webkit", "Safari 3.0", "OSX.4+", 522.1, "A" ]
],
})
.columnFilter({
aoColumns: [ { type: "select", values: [ 'Gecko', 'Trident', 'KHTML', 'Misc', 'Presto', 'Webkit', 'Tasman'] },
{ type: "text" },
null,
{ type: "number" },
{ type: "select", values: [ 'A', 'C', 'U', 'X'] }
]

});
});//end of ready

</script>

<table id="example2">
</table>
</body>
</html>

对此有什么想法

最佳答案

我遇到了同样的问题,并且受 Jay Rizzi 的启发,我添加了一个空页脚。这解决了问题:

<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</tfoot>

显然,如果没有声明 tfoot 部分,columnFilter() 将不会创建一个。

关于jquery数据表列过滤器问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13356872/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com