前端分页插件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 先看 ...
随机推荐
- highchart应用示例2-上:圆角柱状图,下:多指标曲线图
1.ajax调用接口获取数据 function getCityData() { var date1 = $('#datetimepicker1').val(); var date2 = $('#dat ...
- CRM 权限设置 ss
表结构的设计 权限表 url -url地址的正则表达式 ^$ title - 标题 角色表 name - 角色名称 permissions 多对多关联权限表 (权限和角色的关系表) 用户表 name ...
- Django高级
一 登录装饰器 def login_required(view_func): '''登录判断装饰器''' def wrapper(request, *view_args, **view_kwargs) ...
- OpenStack平台上,linux云主机可以使用xshell连接,但是无法xftp连接
笔者在OpenStack云平台上创建了CentOS6.6的云主机,用了一段时间后,发现xshell可以连接,但是xftp却连接不上. 于是进行伟大的百度操作,检查网络设置.ssh服务设置等,均正常,否 ...
- ELK学习笔记之F5利用EELK进行应用数据挖掘系列(2)-DNS
0x00 概述 很多客户使用GTM/DNS为企业业务提供动态智能解析,解决应用就近性访问.优选问题.对于已经实施多数据中心双活的客户,则会使用GSLB提供双活流量调度.DNS作为企业业务访问的指路者, ...
- Docker学习笔记之保存和共享镜像
0x00 概述 让 Docker 引以为傲的是它能够实现相比于其他虚拟化软件更快的环境迁移和部署,在这件事情上,轻量级的容器和镜像结构的设计无疑发挥了巨大的作用.通过将容器打包成镜像,再利用体积远小于 ...
- mysql/oracle jdbc大数据量插入优化
10.10.6 大数据量插入优化 在很多涉及支付和金融相关的系统中,夜间会进行批处理,在批处理的一开始或最后一般需要将数据回库,因为应用和数据库通常部署在不同的服务器,而且应用所在的服务器一般也不会 ...
- dubbo spring pom文件报错:提示no declaration can be found for element 'dubbo:service'.
pom文件报错:The matching wildcard is strict, but no declaration can be found for element 'dubbo:service ...
- CentOS7的安装以及redis的下载安装和连接redis desktop manager出现的问题
因为需要在springboot下使用redis,所以打算在linux下使用redis,并且使用redis desktop manage来连接管理,但是一路上出现个种问题现在总结一下. 如何安装Cent ...
- Docker基础学习-尚硅谷
视频地址:链接: https://pan.baidu.com/s/15sJuEh5cVTJ7-vWSH7vffw 提取码: zf25 笔记: