bootstrap table 显示连续序号,分页有效
参考:http://blog.csdn.net/nazhidao/article/details/51647799
第一种,通过index+1可以简单实现,但是,翻页后又重新从第一个开始
{
field: 'Number',
title: 'Number',
formatter: function (value, row, index) {
return index+;
}
}
第二种,为了能够实现,在翻页时也能后接着上一页的序号显示,下边修改bootstrap 的js库:
在bootstrap-table.js这个js库中找到allowedMethods对象添加一个getPage属性:(红色部分为自己添加,注意逗号)
var allowedMethods = [
'getSelections', 'getData',
'load', 'append', 'remove',
'updateRow',
'mergeCells',
'checkAll', 'uncheckAll',
'check', 'uncheck',
'refresh',
'resetView',
'destroy',
'showLoading', 'hideLoading',
'showColumn', 'hideColumn',
'filterBy',
'scrollTo',
'prevPage', 'nextPage',
'getPage'
];
然后,在js库中,添加方法:
BootstrapTable.prototype.getPage = function (params) {
return {pageSize: this.options.pageSize, pageNumber: this.options.pageNumber};
};
这样就可以在jsp中直接使用了:
{
field:'',
title : '序号',
formatter : function (value, row, index){
var page = $('#task_list').bootstrapTable("getPage");
return page.pageSize * (page.pageNumber - ) + index + ;
}
},
结果:
bootstrap table 显示连续序号,分页有效的更多相关文章
- BootStrap Table显示行号,并且分页后依然递增
bootStrap table 此处使用的是V1.9.0.在网上百度的方法是: { title: '序号', field: '', formatter: function (value, row, i ...
- bootstrap Table 服务端处理分页 后台是.net
要考虑函数可被可重复使用(调用),需要将可变化的变为参数封装起来 function HQCreatTables(ob) { var option = { method: 'get', dataType ...
- bootstrap table 服务器端分页--ashx+ajax
1.准备静态页面 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="Content-T ...
- bootstrap table 分页序号递增问题 (转)
原文地址:https://segmentfault.com/q/1010000011040346 如题,怎么在bootstrap table中显示序号,序号递增,并且分页有效,等于是每页10条,第2页 ...
- [转] BootStrap table增加一列显示序号
原文地址:https://blog.csdn.net/aboboo5200/article/details/78839208 最近由于项目需要,使用BootStrap table做数据展示,其中要在第 ...
- C# Bootstrap table之 分页
效果如图: 一.声明talbe <div class="container"> <table id="table" class="t ...
- [转]C# Bootstrap table之 分页
本文转自:https://www.cnblogs.com/zhangjd/p/7895453.html 效果如图: 一.声明talbe <div class="container&qu ...
- bootstrap table + spring + springmvc + mybatis 实现从前端到后端的表格分页
1.使用准备 前台需要的资源文件,主要有Bootstrap3相关css.js以及bootstrap Table相关css.js: <-- 样式 --> <link rel=" ...
- bootstrap table保留多选框的分页
有时候需要完成这种情况: 1.需要设置的是如果第一页点击复选框然后点击其他页面的话,第一页的选项被保存了 2.将所有选择好的复选款的数据保存在数组中 bootstrap table官方文档http:/ ...
随机推荐
- LR中日志参数的设置
LR中日志参数的设置 1.Run-Time Setting日志参数的设置 在loadrunner的vuser菜单下的Run-Time Setting的General的LOG选项中可以对在执行脚本时Lo ...
- mysqlbinlog flashback 使用最佳实践
mysqlbinlog限制 该软件利用binlog中记录了操作前的数据镜像和操作后的数据镜像.有如下限制 1)binlog_format=row 2)必须打开binlog 3)只支持insert.up ...
- (转)淘淘商城系列——商品搜索功能Dao实现
http://blog.csdn.net/yerenyuan_pku/article/details/72909286 终于进入商品搜索功能的开发中了,本文我来教大家编写实现商品搜索功能的Dao层代码 ...
- swift- mutating
struct Stack<Element> { var items = [Element]() func push(_ item:Element){ self.items.append(i ...
- The Runtime Interaction Model for Views-UI布局事件处理流程
The Runtime Interaction Model for Views Any time a user interacts with your user interface, or any t ...
- 梦想CAD控件安卓参数绘图
在CAD绘图中,参数化绘图可以帮助我们极大缩短设计时间,用户可以按照设计意图控制绘图对象,这样即使对象发生了变化,具体的关系和测量数据仍将保持不变,能够对几何图形和标注进行控制,可以帮助用户应对耗时的 ...
- The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8.0_60\bin;C:\Windows\Sun\Jav
启动项目自动结束,查看日志发现 [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache To ...
- [HNOI]2003 消防局的建立
消防局的建立 本题地址:http://www.luogu.org/problem/show?pid=2279 题目描述 2020年,人类在火星上建立了一个庞大的基地群,总共有n个基地.起初为了节约材料 ...
- Spring MVC学习总结(8)——Swagger入门详解
前言 Swagger 是一款RESTFUL接口的文档在线自动生成+功能测试功能软件.本文简单介绍了在项目中集成swagger的方法和一些常见问题.如果想深入分析项目源码,了解更多内容,见参考资料. S ...
- How to put username &password in MongoDB(Security&Authentication)?(配置用户认证在MongoDB)
Default do not need username and password authenticate when access mongoDB ,I want to set up the use ...