Jquery pagination paged search?

clipboard.png

Click OK search, the page displayed is not correct, normally there should be only 1 page, but the display is 2 pages, breakpoint debugging, paging has not changed, find the reason?
here is the code

sessionStorage.clear();
getDataList(0);
 // initPagination();
 var Flag=0;
 var r = /^\+?[1-9][0-9]*$/;//
$("-sharpsearch-submit").click(function () {
    var searchValue = $("-sharpsearch-txt").val();
    sessionStorage.setItem("g_input", searchValue);
    getDataList(0);
})

var afterAnnoyingOnLoad = true;
function getDataList (pageNo) {
    var pageNo = parseInt(pageNo) + 1;
     $.ajax({
        url: "/webadmin/admin/space/userUsedSpace",
        type: "POST",
        async: false,
        contentType: "application/json;charset=utf-8",
        data:JSON.stringify({
            "corpId" : top.gMain.corpId,
            "pageSize" : 10,
            "pageNo" : pageNo,
            "orderBy" : "totalStorage",
            "userName" : sessionStorage.getItem("g_input")
        }),
        success: function (m) {
            $("-sharpdata-content").empty();
            var dataHTML = [],datalen=0,i;                        
            var resultInfo = JSON.parse(m);                
            if(resultInfo.code == "S_OK") {
                $("-sharphideTotalCount").val(resultInfo.var.totalNumber);
                var totalPage = Math.ceil(resultInfo.var.totalNumber/resultInfo.var.pageSize)
                datalen = resultInfo.var.userUsedSpaces.length;
                for(var i=0;i<datalen;iPP) {
                    dataHTML.push("<tr style="border-bottom: 1px solid -sharpccc;height: 24px;"><td style="border-right: 1px solid -sharpccc;text-align: center;">" + resultInfo.var.userUsedSpaces[i].userName + "</td>");
                    dataHTML.push("<td style="text-align: center;">" + byteTransform(resultInfo.var.userUsedSpaces[i].totalStorage) + "</td></tr>");
                }
                $("-sharpdata-content").append(dataHTML.join(""));
                if($("-sharppager").html().length == "") {
                    Flag = 0;
                    $("-sharppager").pagination(totalPage, {
                        num_edge_entries: 1, //
                        num_display_entries: 3, //                    
                        items_per_page: 10, //1
                        prev_text: "",
                        next_text: "",
                        callback: function (page_index, jq) {
                           if (afterAnnoyingOnLoad) getDataList(page_index);
                           else afterAnnoyingOnLoad = false;
                        }
                    });                                
                }
            }
        },
        error: function (m) {
             alert("");
        }
    });                
}
Mar.03,2021

use another paging plug-in jquery.twbsPagination.js

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b39cdb-2c1ef.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b39cdb-2c1ef.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?