WebRoot/admin/js/jquery.pagination1.js

(开头部分) 9KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。


(function($) {
	$.uiWidget('ui.Pagination', {
		options : /**@lends uedPagination# */
		{
			totalRecord : 0, //总记录条数
			perPageRecord : 10, // 每页显示多少条记录
			currentPage : 1, //当前页码
			displayStyle:[2,3,2], // 页码数(前,中,末)
			showMessage : true, // 显示记录信息
			showPrevNextBtn :true, // 显示左右箭头标识
			
			callback : function(id) {
				return id;
			}
		},
		_create : function() {
			var $el = this.element, options = this.options, self = this;
			var totalRecord = (options.totalRecord < 0) ? 0 : options.totalRecord;
			var $currrentpage = options.currentPage;
			$el.addClass("ue-clear uew-pagination");
			
			// 当无数据或者数据少于每页的最多记录时的情况,不生成分页
			if (totalRecord == 0 && totalRecord < options.perPageRecord) {}
			else {
				this._createPagination();
			}
			
			// 绑定 直接进入某页面 事件
			/*	$(".setPage", $el).live("click", function(evt) {
				var setPageNo = $(this).parent().find("input[name='setPage']").val();
				if (setPageNo != null && setPageNo != "" && setPageNo > 0 && setPageNo <= $.pageNums) {
					self._pageSelected(setPageNo - 1, evt);
				}
			});*/
		},
		_init : function() {
			var $el = this.element, options = this.options, self = this;
			var totalRecord = (options.totalRecord < 0) ? 0 : options.totalRecord;
			var $currrentpage = options.currentPage;
			$el.addClass("ue-clear uew-pagination");
			
			// 当无数据或者数据少于每页的最多记录时的情况,不生成分页
			if (totalRecord == 0 && totalRecord < options.perPageRecord) {
				// 删除先前生成的DOM节点
				$el.children().remove();
			}
			else {
				this._createPagination();
			}
		},
		_createPagination : function() {
			var $el = this.element, options = this.options, self = this, perPageRecord = (!options.perPageRecord || options.perPageRecord < 0) ? 1 : options.perPageRecord, totalRecord = (options.totalRecord < 0) ? 0 : options.totalRecord, currentPage = options.currentPage -1, st = options.showType;

			// 获取总页数
			this.pageNums = this._getPageNums(totalRecord, perPageRecord);

			this._drawLinks();

		},
后面还有 205 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。