jquery完毕pager控件示例_jquery_脚本之家

2019-12-29 作者:亚洲城动态   |   浏览(132)

js:复制代码 代码如下:$.fn.extend({ JPager: function (cfg, pageIndex, pageSize) {if (cfg && pageIndex > 0 && pageSize>0) {var token = "#" this.attr;var pageFirst = function .JPager;};var pagePre = function .JPager(cfg, pageIndex - 1, pageSize);};var pageLast = function .JPager(cfg, parseInt, pageSize);};var pageNext = function .JPager(cfg, pageIndex 1, pageSize);};var pageNumber = function .JPager.text;};var pageGo = function () {var index = parseInt;var total = parseInt;if {if {$.JPager;}else if .JPager;}else {$.JPager;}}};var checkGoNumber = function () {if {this.value = "";}else {this.value = Number;}};var initCustomer = function {if {if (cfg.customer.template) {var t = cfg.customer.template;t = t.replace(/%total%/gi, Math.ceil(recordCount / pageSize)).replace(/%current%/gi, pageIndex).replace(/%recordCount%/gi, recordCount).replace(/%pageSize%/gi, pageSize);if (cfg.customer.position == "right") {$;}else {$;}}}};var changeState = function {if {$.attr;$.attr;}else {$.bind.attr;$.bind.attr;}if {$.attr;$.attr;}else {$.bind.attr;$.bind.attr;}};var initNumber = function (total, count, current) {if (total > 0 && count > 0) {if {current = 1;}if {current = total;}var endIndex = total;var startIndex = 1;var temp = current Math.floor;if {if {endIndex = count;}else {startIndex = temp - count 1;endIndex = temp;}}else {if {startIndex = total - count 1;}}$;for (var i = startIndex; i <= endIndex; i ) {var html = $.text.bind;if {$.append(html.attr;}else {$.append(html.attr;}}}};var initPager = function {if ($.isArray && data.RecordCount > 0) {$.append("首页上一页下一页末页");var total = Math.ceil(data.RecordCount / pageSize);$;$.bind("blur", checkGoNumber);$.bind;changeState;if (cfg.showNumber && cfg.count > 0) {initNumber(total, cfg.count, pageIndex);}initCustomer;}};if {if (cfg.action.url && cfg.action.data) {var d = cfg.action.data.substr(0, cfg.action.data.lastIndexOf ',"pageIndex":' pageIndex ',"pageSize":' pageSize "}";if (cfg.action.callback && $.isFunction {$.ajax({type: "post",url: cfg.action.url,dataType: "json",contentType: "text/json",data: d,success: function {initPager;cfg.action.callback;}else {$.ajax({type: "post",url: cfg.action.url,dataType: "json",contentType: "text/json",data: d,success: function {initPager;

css:复制代码 代码如下:#_pos {width: 40px;}.unable{color: #BCC0BB;}.number{margin: 2px;color:#0000FF;text-decoration:underline; }.selected{margin: 2px;color: #FF0000;font-weight: bold;}

html:复制代码 代码如下:

分页控件示例

wcf:复制代码 代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Runtime.Serialization;using System.ServiceModel;using System.ServiceModel.Activation;using System.ServiceModel.Web;

namespace JPlugin{ [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class JService { [OperationContract] [WebInvoke] public PageObject GetPersons(string name,int pageIndex,int paseSize) { return new PageObject(){RecordCount = 23,SearchResult = new List{Name="zhpulq",Age = 28},new Person(){Name = "zhouxy",Age = 24}}}; } }

public class PageObject { public int RecordCount { get; set; } public List SearchResult { get; set; } }}

本文由yzc216亚洲城发布于亚洲城动态,转载请注明出处:jquery完毕pager控件示例_jquery_脚本之家

关键词: 亚洲城官网 yzc216亚洲城