jquery dataTable分页不出现 [英] jquery dataTable pagination not appearing

查看:1146
本文介绍了jquery dataTable分页不出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 http://datatables.net/ 在grails应用程序中
这是我的初始化代码:

 < g:javascript> 
$(document).ready(function(){
var oTable = $('#projectTable')。dataTable({
bSort:false,
sPaginationType :



oTable.columnFilter({
sPlaceHolder:head:before,
aColumns:[
{sSelector: #projectIdFilter},
{sSelector:#projectNameFilter},
{sSelector:#projectStatusFilter,type:select},
{sSelector:#projectModifiedFilter} ,
{sSelector:#projectActionablesFilter}
]
});
});

function resetFilters(){
var oTable = $('#projectTable')。dataTable();
var oSettings = oTable.fnSettings();
for(iCol = 0; iCol< oSettings.aoPreSearchCols.length; iCol ++){
oSettings.aoPreSearchCols [iCol] .sSearch ='';
}
oTable.fnDraw();
$('#filter_Name')。val('');
$('#filter_Project_ID')。val('');
$('#filter_Modified')。val('');
$('#filter_Status')。val('Status');
$('#filter_Actionables')。val('');
}

< / g:javascript>

我的测试数据覆盖了30个数据行并且工作得很好(过滤,清除过滤器等等)唯一的问题是,分页不会显示出来。





如您所见: 在后台工作(显示1-1中有30个

  • 第一个文本正在出现,尽管不是可点击的页面)



  • 我已经尝试了很多不同的pagingType,bPaginate,bSort,...东西,但似乎没有任何工作。

    有什么想法?问题与底层grails应用程序?



    小插件问题/信息:如果我删除 bSort:false 分页符中断完全和所有项目列出(1到30)在一个页面上。

    解决方案

    我找到了解决方案 - 两种不同的混合jQuery的版本之一由aui(atlassian用户界面)自动包含,另一个由我手动包含。

    解决方案因此:

     

    < script type =text / javascriptcharset =utf8src =// code.jquery.com/jquery-1.10.2.min.js\"></script>


    i am working with http://datatables.net/ within a grails application this is my initialization code:

    <g:javascript>
        $(document).ready(function () {
           var oTable = $('#projectTable').dataTable({
                "bSort": false,
                "sPaginationType": "full_numbers"
            });
    
            oTable.columnFilter({
                sPlaceHolder: "head:before",
                aoColumns: [
                    { sSelector: "#projectIdFilter" },
                    { sSelector: "#projectNameFilter" },
                    { sSelector: "#projectStatusFilter", type: "select" },
                    { sSelector: "#projectModifiedFilter"},
                    { sSelector: "#projectActionablesFilter" }
                ]
            });
        });
    
        function resetFilters() {
            var oTable = $('#projectTable').dataTable();
            var oSettings = oTable.fnSettings();
            for(iCol = 0; iCol < oSettings.aoPreSearchCols.length; iCol++) {
                oSettings.aoPreSearchCols[iCol].sSearch = '';
            }
            oTable.fnDraw();
            $('#filter_Name').val('');
            $('#filter_Project_ID').val('');
            $('#filter_Modified').val('');
            $('#filter_Status').val('Status');
            $('#filter_Actionables').val('');
        }
    
    </g:javascript>
    

    my testdata covers 30 data rows and works just fine (filtering, clearing filters, etc...) the only issue is, that the pagination will not show up.

    as you see:

    • pagination is working in the background (showing 1-1 of 30)
    • First text is appearing, although not clickeable (as currently on first page)

    i have tried a lot of different pagingType, bPaginate, bSort,... things but nothing seems to work.

    Any ideas? issues with the underlying grails application?

    Small addon issue/information: if i remove bSort: false the pagination breaks completely and all projects are listed (1 through 30) on one page.

    解决方案

    I found the solution - a mixup of two different jquery versions one included automatically by aui (atlassian user interface) and another manually by me. the wrong one was chosen in the end and led to missing pagination.

    solution therefore:

    <script type="text/javascript" charset="utf8" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
    

    这篇关于jquery dataTable分页不出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆