3

是否可以在 jquery 数据表中重新加载分页最后一个按钮?

我用过 jquery 数据表,现在我的记录不止一个缺少的数据。所以我有页面初始化 1000 记录加载,然后最后一个分页按钮单击重新加载数据 1000。可以给我任何其他想法...?

供你参考:

 $("#tblExmaple").hide();
jQuery(document).ready(function ($) {
   getRecords();
    function getRecords() {
        jQuery.support.cors = true;
        $.ajax({
            cache: false,
            type: "GET",
            url: "http://localhost:1111/TestSample/api/getRecords",
            datatype: "json",
            data: { Arg1: "Values1",Arg2: "Values2",Arg2: "Values3" },
            statusCode: {
                200: function (data) {
                        $.each(data, function (index, obj) {
                       var colRes1 = obj.Res1;
                        var colRes2 = obj.Res2;
                        var dataAdd = [colRes1, colRes2];                                   
                       getData.push(dataAdd);
                    });
                    // Server Side Code
                  setTimeout(function () {
                        $('#tblExmaple').dataTable({
                            "sPaginationType": "full_numbers",
                            "sScrollXInner": "50%",
                            "sScrollyInner": "110%",
                            "aaData": getData,
                            "iDisplayLength": 8,
                            "sInfoEmpty": false,
                            "bLengthChange": false,
                            "aoColumns": [
                                            { "sTitle": "Column1" },
                                            { "sTitle": "Column2" }
                                         ];
                        })
                    }, 500);
                    setTimeout(function () {
                       $("#tblExmaple").show();
                    }, 500);                                             
                },                                 
                408: function (data) {
                    var response_Text = JSON.stringify(data, undefined, 50);
                    if (data.response_Text == undefined) {
                        window.location = "/Home/Index";
                    }
                    else {
                        timeoutClear();
                    }
                }
            }
        });
    }
4

0 回答 0