Tag:io cti Code re c ar
/**
* Paging Event handling
*/
Function paging () {
$ ("#firstPage"). Click (function () {//home
var pageno = GetPage (' PageNo ');
if (PageNo = = 1) {
Alert ("Already a home page");
}
Else {
Setpage (' PageNo ', ' 1 ');
Loadlistdate ();
}
});
$ ("#prevPage"). Click (function () {//previous
var pageno = getpage (' PageNo ');
if (PageNo <= 1) {
Alert ("Already a home page ");
}
Else {
Setpage (' PageNo ', pageNo-1);
//loadlistdate ();
}
});
$ ("#nextPage"). Click (function () {//Next page
var pageno = getpage (' PageNo ');
var pageSize = getpage (' pageSize '); br> if (PageNo >= pageSize) {
Alert ("Already the last Page");
}
Else {
Setpage (' PageNo ', PageNo + 1);
//loadlistdate ();
}
});
$ ("#lastPage"). Click (function () {//last page
var pageno = getpage (' PageNo ');
var pageSize = getpage (' pageSize ');
if (PageNo = = pageSize) {
Alert ("Already the last Page");
}
Else {
Setpage (' PageNo ', pageSize);
//loadlistdate ();
}
});
}
/**
* Get paging information
* @param {Object} mark| element ID
* Return {Integer} value
*/
function GetPage (Mark) {
var value = $ (' # ' + Mark). Text (). replace (/(^\s*) | ( \s*$)/g, "");
if (value = = "| | value = = NULL | | IsNaN (value)) {
Return ';
}
else {
var trimvalue = parseint (value);
return trimvalue;
}
}
/**
* Set Paging information
* @param {Object} mark| element ID
* @param {Object} value| the value to set
* return void
*/
function Setpage (mark, value) {
$ (' # ' + Mark). Text (value);
}