国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > AJAX > 正文

基于AJAX的分頁類實現代碼

2024-09-01 08:29:24
字體:
來源:轉載
供稿:網友
代碼如下:
/**
* <p>pagination.js
* <p>通用的基于AJAX的分頁類
* @author jeanwendy
* @version 1.0
*/
var paginationIndex = 0;
var pagination = function(trTemplatId) {
    $().ajaxStart(function() {
        $.blockUI({
            message : '<table><tr><td style="vertical-align :bottom"><font size=2pt> 加載數據,請稍后...</font></td></tr></table>'
        });
    }).ajaxStop($.unblockUI);

    paginationIndex = paginationIndex + 1;
    this.id = paginationIndex;
    this.trTemplatId = trTemplatId;
    this.pageNo = 1;
    this.pageSize = 10;
    this.beforeQuery = null;
    this.afterQuery = null;
    this.url = null;
    this.params = null;
    this.templat = null;
    this.childrenCount = null;

    this.setPageNo = function(pageNo) {
        if (pageNo != null)
            this.pageNo = pageNo;
    }
    this.setPageSize = function(pageSize) {
        if (pageSize != null)
            this.pageSize = pageSize;
    }
    this.setBeforeQuery = function(fn){
        this.beforeQuery = fn;
    }
    this.setAfterQuery = function(fn){
        this.afterQuery = fn;
    }

    this.load = function(url, params) {
        //初始化(只在第一次查詢時執行)
        if(this.templat == null && this.childrenCount == null){
            var templatObj = $('#'+this.trTemplatId);
            templatObj.parent().attr('id','tbody_id'+this.id);
            templatObj.removeAttr('id');
            templatObj.wrap("<div id='divTemplat'></div>");
            this.templat = $('#divTemplat').html();
            $('#divTemplat').remove();
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 五华县| 齐河县| 万源市| 七台河市| 拉孜县| 隆回县| 九龙城区| 莲花县| 新乡市| 中超| 河北省| 东乌| 绥宁县| 米易县| 新巴尔虎左旗| 金沙县| 安乡县| 澳门| 北宁市| 望江县| 民乐县| 庄浪县| 息烽县| 景泰县| 枞阳县| 南宁市| 彭泽县| 黄平县| 连云港市| 潞城市| 察隅县| 嘉义市| 武夷山市| 双江| 五河县| 太和县| 定南县| 彩票| 临洮县| 栖霞市| 静海县|