// JavaScript Document
/**//**
* js分页类
* @param iAbsolute 每页显示记录数
* @param sTableId 分页表格属性ID值,为String
* @param sTBodyId 分页表格TBODY的属性ID值,为String,此项为要分页的主体内容
* @Version 1.0.0
* @author 辛现宝 2007-01-15 created
* var __variable__; private
* function __method__(){};private
*/
function Page(iAbsolute,sTableId,sTBodyId)
...{
this.absolute = iAbsolute; //每页最大记录数
this.tableId = sTableId;
this.tBodyId = sTBodyId;
this.rowCount = 0;//记录数
this.pageCount = 0;//页数
this.pageIndex = 0;//页索引
this.__oTable__ = null;//表格引用
this.__oTBody__ = null;//要分页内容
this.__dataRows__ = 0;//记录行引用
this.__oldTBody__ = null;
this.__init__(); //初始化;
};
/**//*
初始化
*/
Page.prototype.__init__ = function()...{
this.__oTable__ = document.getElementById(this.tableId);//获取table引用
this.__oTBody__ = this.__oTable__.tBodies[this.tBodyId];//获取tBody引用
this.__dataRows__ = this.__oTBody__.rows;
this.rowCount = this.__dataRows__.length;
try...{
this.absolute = (this.absolute <= 0) || (this.absolute>this.rowCount) ? this.rowCount : this.absolute;
this.pageCount = parseInt(this.rowCount%this.absolute == 0
? this.rowCount/this.absolute : this.rowCount/this.absolute+1);
}catch(exception)...{}
this.__updateTableRows__();
};
/**//*
下一页
*/
Page.prototype.nextPage = function()...{
if(this.pageIndex + 1 < this.pageCount)...{
this.pageIndex += 1;
this.__updateTableRows__();
}
};
/**//*
上一页
*/
Page.prototype.prePage = function()...{
if(this.pageIndex >= 1)...{
this.pageIndex -= 1;
this.__updateTableRows__();
}
};
/**//*
首页
*/
Page.prototype.firstPage = function()...{
if(this.pageIndex != 0)...{
this.pageIndex = 0;
this.__updateTableRows__();
}
};
/**//*
尾页
*/
Page.prototype.lastPage = function()...{
if(this.pageIndex+1 != this.pageCount)...{
this.pageIndex = this.pageCount - 1;
this.__updateTableRows__();
}
};
/**//*
页定位方法
*/
Page.prototype.aimPage = function(iPageIndex)...{
if(iPageIndex > this.pageCount-1)...{
this.pageIndex = this.pageCount - 1;
}else if(iPageIndex < 0)...{
this.pageIndex = 0;
}else...{
this.pageIndex = iPageIndex;
}
this.__updateTableRows__();
};
/**//*
执行分页时,更新显示表格内容
*/
Page.prototype.__updateTableRows__ = function()...{
var iCurrentRowCount = this.absolute * this.pageIndex;
var iMoreRow = this.absolute+iCurrentRowCount > this.rowCount ? this.absolute+iCurrentRowCount - this.rowCount : 0;
var tempRows = this.__cloneRows__();
//alert(tempRows === this.dataRows);
//alert(this.dataRows.length);
var removedTBody = this.__oTable__.removeChild(this.__oTBody__);
var newTBody = document.createElement("TBODY");
newTBody.setAttribute("id", this.tBodyId);
for(var i=iCurrentRowCount; i < this.absolute+iCurrentRowCount-iMoreRow; i++)...{
newTBody.appendChild(tempRows[i]);
}
this.__oTable__.appendChild(newTBody);
/**//*
this.dataRows为this.oTBody的一个引用,
移除this.oTBody那么this.dataRows引用将销失,
code:this.dataRows = tempRows;恢复原始操作行集合.
*/
this.__dataRows__ = tempRows;
this.__oTBody__ = newTBody;
//alert(this.dataRows.length);
//alert(this.absolute+iCurrentRowCount);
//alert("tempRows:"+tempRows.length);
};
/**//*
克隆原始操作行集合
*/
Page.prototype.__cloneRows__ = function()...{
var tempRows = [];
for(var i=0; i<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
无标题文档
Last Name
First Name
Birthday
Siblings
Smith |
John |
7/12/1978 |
2 |
Johnson |
Betty |
10/15/1977 |
4 |
Henderson |
Nathan |
2/25/1949 |
1 |
Williams |
James |
7/8/1980 |
4 |
Gilliam |
Micheal |
7/22/1949 |
1 |
Smith |
John |
7/12/1978 |
2 |
Johnson |
Betty |
10/15/1977 |
4 |
Henderson |
Nathan |
2/25/1949 |
1 |
Williams |
James |
7/8/1980 |
4 |
Gilliam |
Micheal |
7/22/1949 |
1 |
分享到:
相关推荐
技术精品文章,请访问CSDN博客:http://blog.csdn.net/ 全球最大的中文技术讨论区,请访问CSDN论坛:http://bbs.csdn.net/ 分享您认为最好的内容,请访问CSDN网摘:http://wz.csdn.net/ IT企业觅人才,个人找...
标题中的“博客https://blog.csdn.net/weixin_49457347/article/details/1236所需文件”表明这是一个与特定博客文章相关的压缩包,但没有提供足够的信息来直接解释博客的内容。从描述中也无法获取更多细节,它只是...
技术精品文章,请访问CSDN博客:http://blog.csdn.net/ 全球最大的中文技术讨论区,请访问CSDN论坛:http://bbs.csdn.net/ 分享您认为最好的内容,请访问CSDN网摘:http://wz.csdn.net/ IT企业觅人才,个人找工作,请...
JQuery基础教程之前言和前三章:http://download.csdn.net/source/745869 JQuery基础教程之第四章:http://download.csdn.net/source/745907 JQuery基础教程之第五章:http://download.csdn.net/source/745975 JQuery...
python姿态检测实现多人多姿态识别python行为识别openpose行为骨骼框架检测动作识别动作检测行为动作分类part1 需要下载其他压缩包放一个文件夹内解压...part6:https://download.csdn.net/download/babyai996/88741274
https://blog.csdn.net/a6661314/article/details/124358796的实验文件
DataList分页1:http://blog.csdn.net/zhyuanshan/archive/2007/10/30/1855507.aspx DataList分页2: http://blog.csdn.net/zhyuanshan/archive/2008/01/10/2033688.aspx
简单的学生信息管理系统,实现对用户类型的不同权限管理(增删改查). 文章介绍:https://blog.csdn.net/qq_56886142/article/details/122740969?spm=1001.2014.3001.5501
在《teacatcn的专栏》http://blog.csdn.net/teacatcn/archive/2008/01/23/2060482.aspx (注:該專欄中又引用《Jo Muncher's Blog》http://blog.csdn.net/JoMuncher/archive/2007/11/02/1862977.aspx) 看到...
顺序表:https://blog.csdn.net/HAIIAKU/article/details/119302855 单链表:https://blog.csdn.net/HAIIAKU/article/details/119303873 顺序栈:https://blog.csdn.net/HAIIAKU/article/details/119304169 冒泡排序...
这是本人过去收集网上的清晰扫描图片,和预览样章合并制成的pdf。由于当时是自已学习用,所以边看边制目录书签。现在放上来希望能攒点分。由于文件有127M大,所以...第六分卷:http://download.csdn.net/source/3000440
软件的安装和使用说明可以参考博文《手把手教你上手Proteus(下载安装+仿真51单片机程序)》( https://xiaohuisuper.blog.csdn.net/article/details/121993865 ) Proteus软件的功能很强大,它集合了电路仿真、PCB...
http://blog.csdn.net/xiangjianbo127/article/details/8610007 http://blog.csdn.net/xiangjianbo127/article/details/8610413 http://blog.csdn.net/xiangjianbo127/article/details/8610755 ...
Socket实战——UDP连接:https://blog.csdn.net/haoranhaoshi/article/details/86601468 Socket实战——TCP连接:https://blog.csdn.net/haoranhaoshi/article/details/86601522 Socket实战——查询数据库:...
Qt之TCP收发图片的例子 详见博客:https://blog.csdn.net/caoshangpa/article/deta
[license]https://download.csdn.net/download/qq345162168/12579760 [part1]https://download.csdn.net/download/qq345162168/12579642 [part2]https://download.csdn.net/download/qq345162168/12579654 [part3]...
此更新包仅限于升级已有的程序至最新版(如从V1.0版、V1.1版、V1.2版、V2.0版、V2.1版、V2.5版、V3.0版以及V3.2标准版升级到V3.2增强版),如果您之前...程序链接:http://blog.csdn.net/vbcom/article/details/7245186
文章链接:https://blog.csdn.net/Jeankyw/article/details/131890436?spm=1001.2014.3001.5502
基于STM32F103单片机,通过PAJ7620手势识别模块实时检测并打印手势类型到串口调试助手。各位同学可基于该例程并根据自己的项目...更多详情,请浏览博客文章→https://xinso.blog.csdn.net/article/details/120616257
图像对比,博客https://blog.csdn.net/bigdata1994pb/category_11750065.htm图像对比,博客https://blog.csdn.net/bigdata1994pb/category_11750065.htm