前端分页插件bootstrapPaginator的使用
<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的使用的更多相关文章
- Jquery前端分页插件pagination同步加载和异步加载
上一篇文章介绍了Jquery前端分页插件pagination的基本使用方法和使用案例,大致原理就是一次性加载所有的数据再分页.https://www.jianshu.com/p/a1b8b1db025 ...
- 前端分页插件pagination
摘要: 最近在开发项目中又用到了前端分页,以前也做过,为了方便以后使用所以将他封装成第三方插件,不依赖任何库.网上已经有很多插件,问什么还要自己造轮子? 自己写的扩展性高 不依赖任何库 作为一次技术沉 ...
- 一款基于Bootstrap的js分页插件bootstrap-paginator使用实例
Bootstrap Paginator是一款基于Bootstrap的js分页插件,功能很丰富.它提供了一系列的参数用来支持用户的定制,提供了公共的方法可随时获得插件状态的改变,以及事件来监听用户的动作 ...
- Jquery前端分页插件pagination使用
插件描述:JqueryPagination是一个轻量级的jquery分页插件.只需几个简单的配置就可以生成分页控件.并且支持ajax获取数据,自定义请求参数,提供多种方法,事件和回调函数,功能全面的分 ...
- angularJS前端分页插件
首先在项目中引入 分页插件的 js 和 css: 在html页面引入 相关js 和 css: 在控制器中引入分页插件中定义的 module[可以打开pagination.js查看,可以看到 其实,在插 ...
- 品优购商城项目(二)mybatis分页插件
品优购商城项目第二天,使用mybatis分页插件实现分页.主要实现的是 SSM整合mybatis分页. 一.引用mybatis分页插件 SqlMapConfig.xml <?xml versio ...
- 前端分页神器,jquery grid的使用(前后端联调),让分页变得更简单。
jquery grid 是一款非常好用的前端分页插件,下面来讲讲怎么使用. 首先需要引入jquery grid 的CSS和JS (我们使用的是bootstrap的样式) 下面我们通过一个例子来讲解,需 ...
- bootstrap-paginator 分页插件笔记
[MVC]bootstrap-paginator 分页插件笔记 bootstrap-paginator基于bootstrap框架,使用起来非常简单.官网:http://harttle.github ...
- Bootstrap分页插件:bootstrap-paginator
今天和大家分享一个Bootstrap的分页插件:bootstrap-paginator. 插件地址: https://github.com/lyonlai/bootstrap-paginator 先看 ...
随机推荐
- バイナリハックイージー / Unhappy Hacking (ABC Edit) (stack)
题目链接:http://abc043.contest.atcoder.jp/tasks/abc043_b Time limit : 2sec / Memory limit : 256MB Score ...
- 教你如何修改CentOS系统上的时间
直接看命令:
- 大神教你Nginx常用基础配置方案
Nginx的fastcgi模块参数设置 Nginx 有两个配置文件fastcgi_params.fastcgi.conf,两者唯一的区别是,fastcgi.conf 多一个参数 SCRIPT_FILE ...
- 使用WebClient下载网页,用正则匹配需要的内容
WebClient是一个操作网页的类 webClient web=new WebClient(): web.DownloadString(网页的路径,可以是本地路径);--采用的本机默认的编码格式 ...
- UVA - 748 Exponentiation
Problems involving the computation of exact values of very large magnitude and precision are common. ...
- SolrCloud集群配置
前提: 1,已经做好zookeeper集群或伪集群配置. 2,已将solr部署到tomcat中 接下来,我们将zookeeper与tomcat进行关联 vim tomcat/bin/catalina. ...
- 获取RadioButton选中的值
1.RadioButtonList的RepeatDirection="Horizontal"可以设置按扭选项横对齐: 2.获取选中的RadioButton值; $("#& ...
- Received empty response from Zabbix Agent at [172.16.1.7]...
Centos7.5 zabbix添加主机发现ZBX爆红报错 原因:在配置/etc/zabbix/zabbix_agentd.conf中172.16.1.71写成了127.16.1.71 解决方法:重 ...
- Qt5使用QFtp,二次封装
1.需要的东西 ftp.cpp,ftp.h是二次封装的ftp类,放在工程下包含 QFtp和qftp.h放在D:\Qt5.7.1\5.7\msvc2013\include\QtNetwork: Qt5F ...
- scrapy - Request 中的回调函数不执行
在 scrapy 中, scrapy.Request(url, headers=self.header, callback=self.parse) 调试的时候,发现回调函数 parse_detail ...