国产探花免费观看_亚洲丰满少妇自慰呻吟_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();
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 新疆| 同德县| 织金县| 长葛市| 封丘县| 进贤县| 三原县| 泸州市| 深泽县| 昌乐县| 卢湾区| 藁城市| 甘孜县| 定陶县| 石泉县| 新蔡县| 翼城县| 贺兰县| 蓬安县| 济南市| 西畴县| 珲春市| 萍乡市| 清新县| 三穗县| 芒康县| 温宿县| 张家港市| 彰化县| 高台县| 开远市| 四川省| 阳江市| 西藏| 海安县| 杭锦后旗| 万州区| 井研县| 磐石市| 郯城县| 马尔康县|