laytable Front loading data after deleting the current page.

After laytable-time data acquisition, click Delete to delete call back. After a successful return to the state to refresh the current page data.

Rendering methods:

    // Render table 
    function renderingTable (the pageIndex, the sourceData, COUNT, MSG) {
         var obj = { 
            elem: '#table_data' , 
            Data: the sourceData, 
            cols: [[ 
                {Field: 'SITE_DATABASE_ID', title: 'SITE_DATABASE_ID', hide: to true ,} 
                , {Field: 'DATA_NAME', title: 'database name' } 
                , {Field: 'TABLE_NAME', title: 'table', Sort: to true } 
                , {Field: 'table_info', title: 'table describes ', sort:true } 
                ,{
                    field: 'IS_VERTICAL_TABLE', title: '是否竖表', sort: true, templet: function (res) {
                        if (res.IS_VERTICAL_TABLE == 1) {
                            return "是";
                        } else {
                            return "否";
                        }
                    }
                }
                , { field: 'VERTICAL_TABLE_KEY_COLUMNAME', title: '竖表主键1', sort: true }
                , { field: 'VERTICAL_TABLE_KEY2_COLUMNAME',title: 'vertical primary key 2', sort:to true  }
                , {Field: 'TIME_COLUMN_NAME', title: 'data time series', Sort: to true } 
                , { 
                    Field: 'TIME_IS_REPEAT', title: 'Time column value whether to repeat', Sort: to true , Templet: function (RES) {
                         IF (res.TIME_IS_REPEAT ==. 1 ) {
                             return "is" ; 
                        } the else {
                             return "NO" ; 
                        } 
                    } 
                } 
                , {Field:'SELECFT_CONDITION', title: 'Sql query condition', Sort: to true } 
                , { 
                    Field: 'IS_CLIENT_GET', title: 'client state acquisition', Sort: to true , Templet: function (RES) {
                         IF (= res.IS_CLIENT_GET . 1 = ) {
                             return "acquisition" ; 
                        } the else {
                             return "not acquired" ; 
                        } 
                    } 
                } 
                , {Field: 'CREATE_TIME', title: 'created', sort:true }
                , { fixed: 'right', title: '操作', align: 'center', toolbar: '#operation' }
            ]],
            count: count,
            height: $(".partial-content").height() - parseInt($(".page-content").css("padding-top")) - parseInt($(".page-content").css("padding-bottom")) - $(".div_select").height() - 90,
            page: {
                curr: pageIndex,
                limit: 15,
                limits: [15, 50, 100],
            },
            totalRow: false,
            skin: 'line ',
            even: false,
            loading: true,
            parseData: function (res) {
                return {
                    "msg": msg
                    , "count": count
                };
            }
        };
        tableData = laytable.render(obj);
    };

Remove the code:

    // delete 
    function deleteData (BaseID) { 
        layer.confirm ( 'OK to delete it?' , { 
            Btn: [ 'OK', 'Cancel' ] 
        }, function () {
             var parm = { 
                BaseID: BaseID 
            } 
            $ .majax ( { 
                type: "Post" , 
                URL: "/ ClientGetTableConfig / the DeleteData" , 
                Data: parm, 
                dataType: "JSON" , 
                Success:function (data) {
                     were datas = JSON.parse(data);
                    if (datas.Success == 1) {
                        $.layermsg_s('删除成功', 1);
                        tableData.config.data = tableData.config.data.filter((item) => item.SITE_DATABASE_ID != baseId);
                        var pageSum = parseInt(tableData.config.data.length / tableData.config.limit);
                        var pageIndex = tableData.config.page.curr;
                        pageSum = tableData.config.data.length % tableData.config.limit > 0 ? pageSum + 1 : pageSum;
                        pageIndex = pageIndex > pageSum ? pageSum : pageIndex;
                        renderingTable(pageIndex, tableData.config.data, tableData.config.data.length, "");
                    }
                    else {
                        $.layermsg_e(datas.SuccessStr, 1);
                    }
                }
            });
        });
    };
 After rendering the table laytable.render returned object has everything you want 

Minato words
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of
laytable get the current page, laytable get the current number of

Guess you like

Origin www.cnblogs.com/zszs/p/10967054.html