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("");
}
});
}