引入bootstrap-paginator.js

<table class="table table-striped table-bordered table-hover dataTable no-footer" role="grid" aria-describedby="sample_2_info">
<thead>
<tr role="row">
<th tabindex="0" aria-label="">
**
</th>
<th tabindex="0" aria-label="">
**
</th>
<th tabindex="0" aria-label="">
**
</th>
<th tabindex="0" aria-label="">
**
</th>
<th tabindex="0" aria-label="">
**
</th>
<th tabindex="0" aria-label="">
**
</th>
<th tabindex="0" aria-label="">
**
</th>
<th tabindex="0" aria-label="">
**
</th>
</tr>
</thead>
<tbody id="tableBody"></tbody>
</table>
<div class="paging-toolbar">
<ul id="grid_paging_part"></ul>
</div>
<script>
$(function () {
loadTables(1, 10);
}); function loadTables(startPage, pageSize) {
$("#tableBody").html("");
$.ajax({
type: "GET",
url: "/Transaction/GetRecordList?startPage=" + startPage + "&pageSize=" + pageSize,
success: function (data) {
$.each(data.rows, function (i, item) {
var tr = "<tr>";
tr += "<td>" + item.orderId + "</td>";
tr += "<td>" + item.appName + "</td>";
tr += "<td>" + item.realName + "</td>";
tr += "<td>" + item.accountTypeName + "</td>";
tr += "<td>" + item.transAmount + "</td>";
tr += "<td>" + item.transTime.replace("T", " ") + "</td>";
if (item.transType == '1') {
tr += "<td>**</td>";
}
if (item.transType == '2') {
tr += "<td>**</td>";
}
if (item.flag == '0') {
tr += "<td>**</td>";
}
else {
tr += "<td>**</td>";
}
tr += "</tr>";
$("#tableBody").append(tr);
})
var elment = $("#grid_paging_part"); //分页插件的容器id
if (data.rowCount > 0) {
var options = { //分页插件配置项
bootstrapMajorVersion: 3,
currentPage: startPage, //当前页
numberOfPages: data.rowsCount, //总数
totalPages: data.pageCount, //总页数
shouldShowPage: function (type, page, current) {
var result = !0;
switch (type) {
case "first":
result = 1 !== current;
break;
case "prev":
result = 1 !== current;
break;
case "next":
result = current !== this.totalPages;
break;
case "last":
result = current !== this.totalPages;
break;
case "page":
result = !0
}
return result
},
itemTexts: function (type, page, current) {//设置显示的样式,默认是箭头
switch (type) {
case "first":
return "首页";
case "prev":
return "上一页";
case "next":
return "下一页";
case "last":
return "末页";
case "page":
return page;
}
},
onPageChanged: function (event, oldPage, newPage) { //页面切换事件
loadTables(newPage, pageSize);
}
}
elment.bootstrapPaginator(options); //分页插件初始化
}
}
})
}; </script>

前端分页插件bootstrapPaginator的使用的更多相关文章

  1. Jquery前端分页插件pagination同步加载和异步加载

    上一篇文章介绍了Jquery前端分页插件pagination的基本使用方法和使用案例,大致原理就是一次性加载所有的数据再分页.https://www.jianshu.com/p/a1b8b1db025 ...

  2. 前端分页插件pagination

    摘要: 最近在开发项目中又用到了前端分页,以前也做过,为了方便以后使用所以将他封装成第三方插件,不依赖任何库.网上已经有很多插件,问什么还要自己造轮子? 自己写的扩展性高 不依赖任何库 作为一次技术沉 ...

  3. 一款基于Bootstrap的js分页插件bootstrap-paginator使用实例

    Bootstrap Paginator是一款基于Bootstrap的js分页插件,功能很丰富.它提供了一系列的参数用来支持用户的定制,提供了公共的方法可随时获得插件状态的改变,以及事件来监听用户的动作 ...

  4. Jquery前端分页插件pagination使用

    插件描述:JqueryPagination是一个轻量级的jquery分页插件.只需几个简单的配置就可以生成分页控件.并且支持ajax获取数据,自定义请求参数,提供多种方法,事件和回调函数,功能全面的分 ...

  5. angularJS前端分页插件

    首先在项目中引入 分页插件的 js 和 css: 在html页面引入 相关js 和 css: 在控制器中引入分页插件中定义的 module[可以打开pagination.js查看,可以看到 其实,在插 ...

  6. 品优购商城项目(二)mybatis分页插件

    品优购商城项目第二天,使用mybatis分页插件实现分页.主要实现的是 SSM整合mybatis分页. 一.引用mybatis分页插件 SqlMapConfig.xml <?xml versio ...

  7. 前端分页神器,jquery grid的使用(前后端联调),让分页变得更简单。

    jquery grid 是一款非常好用的前端分页插件,下面来讲讲怎么使用. 首先需要引入jquery grid 的CSS和JS (我们使用的是bootstrap的样式) 下面我们通过一个例子来讲解,需 ...

  8. bootstrap-paginator 分页插件笔记

    [MVC]bootstrap-paginator 分页插件笔记   bootstrap-paginator基于bootstrap框架,使用起来非常简单.官网:http://harttle.github ...

  9. Bootstrap分页插件:bootstrap-paginator

    今天和大家分享一个Bootstrap的分页插件:bootstrap-paginator. 插件地址: https://github.com/lyonlai/bootstrap-paginator 先看 ...

随机推荐

  1. 新服务器上装java PHP环境有什么一键安装的方便的方法?一般都是怎么安装环境的?

     新服务器上装java PHP环境有什么一键安装的方便的方法?一般都是怎么安装环境的?  linode digitalocean都有很好的教程,下面是ubuntu和centos的两个教程连接. How ...

  2. oracle表分区、表分析及oracle数据泵文件导入导出

    1.先说oracle表分区是什么吧 你有500万份文件,你要把他存在磁盘上,好嘛,我们就一个文件夹,500万分文件在那儿杵着,我们想找到要的那个打开,嘿嘿,我们得找到什么时候. 这时候,有个人告诉你, ...

  3. strace跟踪多进程与内核的交互

    1.ptrace的说明 ptrace原型: #include <sys/ptrace.h> long ptrace(enum __ptrace_request request, pid_t ...

  4. 算法提高 P0101

    一个水分子的质量是3.0*10-23克,一夸脱水的质量是950克.写一个程序输入水的夸脱数n(0 <= n <= 1e10),然后输出水分子的总数.输入 109.43输出 3.465283 ...

  5. scanf,fscanf,sscanf的区别

    scanf是从文件中读 sscanf是从字符串中读 scanf是从键盘输入中读   fread :以字节位计算长度,按照指定的长度和次数读取数据,遇到结尾或完成指定长度读取后停止.fscanf :格式 ...

  6. Zookeeper集群方式安装

    分布式安装部署 配置系统环境变量等 /etc/profile export JAVA_HOME=/opt/app/jdk1.8.0_181 #export CLASSPATH=.:${JAVA_HOM ...

  7. Spring RestController 请求参数详解

    Spring RestController 请求参数详解 引用作者jpfss 在阅读之前,最好先了解http请求的get,post,以及各种head头类型,请求参数类型. 无参数,设置RestCont ...

  8. P3813 [FJOI2017]矩阵填数(组合数学)

    P3813 [FJOI2017]矩阵填数 shadowice1984说:看到计数想容斥........ 这题中,我们把图分成若干块,每块的最大值域不同 蓝后根据乘法原理把每块的方案数(互不相干)相乘. ...

  9. TCP 之 RST 原因分析

    5. 往一个对端已经关闭的套接字上写入数据会收到一个RST信号 1.发送端的 发送缓冲区还有数据,但接收端tcp的接收通道已关闭 2. SYN到达某端口但此端口上没有正在监听的服务器.对于UDP,当一 ...

  10. jsonp获取股票信息

    源码: <script src="http://hq.sinajs.cn/list=sh600050" charset="gb2312"></ ...