مركز المحتوى
سجّلآخر الأخبار
الإعلام
النشرة الإخبارية
النشرة الإخبارية | سنة | حجم الملف |
---|
-
- 0) {
$(".newsletter-pagination").hide();
} else {
$(".newsletter-pagination").show();
getNewsLetterList();
}
});
$('#search').keypress(function (event) {
if (event.keyCode == 13) {
pageStart = 0;
getNewsLetterList();
}
});
});
function handleSearch() {
pageStart = 0;
getNewsLetterList();
}
function SetSort(val,ordertype) {
orderBy = val;
order = ordertype;
getNewsLetterList();
}
function SetPageNumber(val) {
pageStart = val * records;
currentPage = val;
getNewsLetterList();
}
function getNewsLetterList() {
search = $('#search').val();
records = $('#Records').find("option:selected").val();
searchBy = $('#searchBy').find("option:selected").val();
var sortBy = $('#sortBy').find("option:selected").val();
var pageno = currentPage;
$.ajax({
url: "/umbraco/surface/wetexdatasurface/GetNewsLetterList?PageNumber=" + pageno + "&Records=" + records + "&OrderBy=" + orderBy + "&Search=" + search + "&SearchBy=" + searchBy + "&dataId=" + $("#dataId").val() + "&cultureName=" + $("#culture_Name").val() + "&order=" + order + "&sortby=" + sortBy,
Type: 'get',
success: function (data) {
$('#tb_newsletter').html("");
$('#tb_newsletter').html(data);
var a = $.parseHTML(data)[1];
if (a != undefined) {
var listLi = "";
let total = parseInt(a.cells[0].id);
//debugger;
$("#TotalRecords").html("");
$("#TotalRecords").html(total);
$("#pageStart").html("");
$("#pageStart").html(((parseInt(pageno-1) * parseInt(records)) + 1));
$("#records").html("");
if (parseInt(pageStart) == 0) {
$("#records").html(parseInt(records));
} else {
$("#records").html((parseInt(pageStart)) > total ? total : (parseInt(pageStart)));
}
$("#pagination").html("");
if (currentPage > 1) {
listLi += "
- "; } else{ listLi += "
- "; } let totalRecordsdecimal = total / records; let totalRecords = Math.round(total / records); if (totalRecords < totalRecordsdecimal) { totalRecords = totalRecords + 1; } //let remainingRecords = Math.round(total % records); if (total <= records) { $("#pagination").hide(); } else { $("#pagination").show(); } /*if (remainingRecords > records) { totalRecords = Math.round(remainingRecords / records); } else if (remainingRecords > 0 && remainingRecords < records) { totalRecords = totalRecords - 1; }*/ var PageLeft = 2; var PagesRight = 2; var pageCount = totalRecords; // get first page befor ... var fromPage = Math.max(1, currentPage - PageLeft); // get last page after ... var toPage = Math.min(pageCount, currentPage + PagesRight); if (pageCount - toPage == 1) { toPage = pageCount; } if (fromPage > 1) { // view First page listLi += "
- 1 "; if (fromPage > 2) { // view first ... // calculate number page for link ..., it's middle between first page and fromPage var middleNumber = parseInt(Math.ceil(Math.round(fromPage - 2) / 2) + 1); listLi += "
- ... "; } } // view paginator between currentPage for (var i = fromPage; i <= toPage; i++) { if (i == currentPage) { listLi += "
- " + i + " "; } else { listLi += "
- " + i + " "; } } // view second ... if (toPage < pageCount) { var middleNumber = parseInt(Math.ceil(Math.round(pageCount - toPage) / 2) + toPage); listLi += "
- ... "; // view last page if (toPage < pageCount - 1) { listLi += "
- " + pageCount + " "; } } if (currentPage < pageCount) { listLi += "
- "; } else { listLi += "
- "; } $("#pagination").append(listLi); listLi = ""; //for (var i = 1; i < totalRecords; i++) { // var listLi = ""; // if (i == currentPage) { // listLi = "
- " + i + " "; // } // else { // listLi = "
- " + i + " "; // } // $("#pagination").append(listLi); // listLi = ""; //} jQuery(window).trigger('m19.reinit'); } } }); }
خارطة معرض ويتيكس 2025
دليل العارضين لمعرض ويتيكس 2025
مجالات العرض