jquery datatables制作ajax分页二

$(function () {
    if($('#dataTables')){
        var conditionUrl;
        var conditionJson={export:'1'};
        var searchType;

       $('#doSubmit').click(function () {
            var searchArr =[],searchUrl='';
            conditionUrl = "/aaa/ajaxRtData.html?aa="+aa+"&"+searchConditions + Math.random();
            initTable(conditionUrl);
        });
        function initTable(url) {
            var table = $("#dataTables").dataTable({
                "bServerSide": true,
                "sAjaxSource": url,
                "bProcessing": true,
                "bDestroy": true,
                'autoWidth': false,
                "bFilter": false,
                "searching": true,
                "oLanguage": {
                    "sProcessing": "  ",
                    "sLengthMenu": "每页 _MENU_ 项",
                    "sZeroRecords": "没有匹配结果",
                    "sInfo": "当前显示第 _START_ 至 _END_ 项,共 _TOTAL_ 项。",
                    "sInfoEmpty": "当前显示第 0 至 0 项,共 0 项",
                    "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                    "sInfoPostFix": "",
                    "sSearch": "搜索:",
                    "sUrl": "",
                    "sEmptyTable": "表中数据为空",
                    "sLoadingRecords": "载入中...",
                    "sInfoThousands": ",",
                    "oPaginate": {
                        "sFirst": "首页",
                        "sPrevious": "上页",
                        "sNext": "下页",
                        "sLast": "末页",
                        "sJump": "跳转"
                    },
                    "oAria": {
                        "sSortAscending": ": 以升序排列此列",
                        "sSortDescending": ": 以降序排列此列"
                    }
                },
                "columnDefs": [
                    {"render": function (data, type, row) {return row['aa'];},'orderable':false,"targets":0},

                ]
            });
            return table;
        }
    }

// 后台返回格式为
        $listData=array(
            'data'=>$arr,
            'iTotalRecords'=>count($arr),
            'iTotalDisplayRecords'=>count($arr),
        );

随机浏览