问题简而言之,在Jquery Datables中启用scrollX / scrollY会隐藏列过滤器插件:https://github.com/vedmack/yadcf/issues/43
我在这里放了一些代码:
http://jsfiddle.net/LAeVx/6/
我的主要代码:
$('#displayList').dataTable({
"bServerSide": false,
"bJQueryUI": true,
"asStripClasses": ['even', 'odd ui-state-default'],
"oLanguage": { "sProcessing": "<div class='processing-div ui-state-focus w120 ui-corner-all'><div style='float:left;'><img src='Styles/images/Spinner.gif'></div><div style='float:left;margin:10px 5px;'>Loading...</div><div class='cleardiv'></div></div>" },
"oLanguage": { "sZeroRecords": "No dlns available", "sEmptyTable": "No dlns available" },
"bProcessing": true,
"bDeferRender": true,
"bLengthChange": true,
"bDestroy": true,
"bFilter": true,
"sPaginationType": "full_numbers"
}).yadcf([{
column_number: 0,
filter_type: "text"
}, {
column_number: 1,
filter_type: "text"
}, {
column_number: 2,
filter_type: "text"
}, {
column_number: 3,
filter_type: "text"
}, {
column_number: 4,
filter_type: "text"
},
{
column_number: 5,
filter_type: "text"
},
{
column_number: 6,
filter_type: "text"
},
{
column_number: 7,
filter_type: "text"
},
{
column_number: 8,
filter_type: "text"
},
{
column_number: 9,
filter_type: "text"
},
{
column_number: 10,
filter_type: "text"
},
{
column_number: 11,
filter_type: "text"
},
{
column_number: 12,
filter_type: "text"
},
{
column_number: 13,
filter_type: "text"
},
{
column_number: 14,
filter_type: "text"
},
{
column_number: 15,
filter_type: "text"
},
{
column_number: 16,
filter_type: "text"
},
{
column_number: 17,
filter_type: "text"
},
{
column_number: 18,
filter_type: "text"
},
{
column_number: 19,
filter_type: "text"
},
{
column_number: 20,
filter_type: "text"
},
{
column_number: 21,
filter_type: "text"
},
{
column_number: 22,
filter_type: "text"
}]);
有没有人能够为这个插件实现水平滚动?我无法让解决方案为我工作。
答案 0 :(得分:0)
只需添加数据表选项
"sScrollX": "100%",
我希望能帮到你
答案 1 :(得分:0)
yadcf支持sScrollX / sScrollY(以及scrollX / scrollY)自0.8.5.beta.4以来的版本,你可以grab it from here