How does bootstrap-table background pagination display the total number of data items?

clipboard.png
normally, it should show how many articles from the first to the first, how many articles in total, why mine become zero? do you need to write your own js to dynamically load this

?
  var oTableInit = new Object();
    //Table
    oTableInit.Init = function () {
        $("-sharptb_internJob").bootstrapTable({
            url: "http://localhost:8070/",         //URL*
            method: "post",                      //*
            toolbar: "-sharptoolbar",                //
            striped: true,                      //
            cache: false,                       //true*
            pagination: true,                   //*
            sortOrder: "asc",                   //
            queryParamsType:"",
            paginationShowPageGo: true,
            showJumpto: true,
            pageNumber: 1, //
            queryParams:queryParams,//
            sidePagination:"server",//
            pageSize:1,//
            pageList:[2,3,4,5],//
            smartDisplay:false,
            search: true, //
            silent: true,
            showColumns: true,                  //
            showRefresh: true,                  //
            minimumCountColumns: 2,             //
            // clickToSelect: true,                //
            // height: 500,                        //height
            uniqueId: "internshipJobId",                     //
            columns: [{
                checkbox: true
            }, {
                field: "jobName",
                title: "",
                align: "center",
            }, {
                field: "releaseTime",
                title: "",
                align: "center"
            }, {
                field: "expiredTime",
                title: "",
                align: "center"
            },{
                field: "operation",
                title: "",
                align: "center",
                events:operateEvents,//
                formatter:addFunctionAlty//
            }]
        });
    };

    // 
    function queryParams(params) {
        var temp = {   //
            pageNum: params.pageNumber,
            pageSize: params.pageSize,
            jobType:jobType,
            isExpired:isExpired
        };
        return temp;
    };
    return oTableInit;
};
Mar.17,2021

the server needs to return a field with a total number of entries, such as "total": 800


when using bootstrap-table server-side paging, the data returned by the server must have two fields: total, and rows. If the backend does not return such fields and the foreground does not process the returned data, my situation will occur


.

the format of the data you need to return from the server is:

{
    "total": 200,
    "rows": [XXX]
}

"total": XXX,


xi modifies the source code to concatenate the c in the function, that is, the total number of entries clipboard.png

clipboard.png

.
Menu