bootstrap server分页
来源:互联网 发布:陈坤长相知乎 编辑:程序博客网 时间:2024/06/06 03:43
bootstrap版本 为 3.X
bootstrap-table.min.css
bootstrap-table-zh-CN.min.js
bootstrap-table.min.js
前端bootstrap+jQuery,服务端使用spring MVC实现restful风格服务
前端代码块
- 1
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
在前端通过请求获取table数据时,bootstrap table会默认拼一个 searchText的参数,来支持查询功能。
服务端代码
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
完成上述代码,即可实现服务器端自动分页,bootstrap-table根据服务器端返回的total,以及table设定的pageSize,自动生成分页的页面元素,每次点击下一页或者指定页码,bootstrap-table会自动给参数pageNumber赋值,服务器返回指定页的数据。
如果发送的是post请求,因为bootstap table使用的是ajax方式获取数据,这时会将请求的content type默认设置为 text/plain,这样在服务端直接通过 @RequestParam参数映射是获取不到的。
这时就需要在bootstrap-table的参数列表中显式设置
- 1
设置成form表单的形式,tomcat内部就会自动将requset payload中的数据部分解析放到request.getParameter()中,之后就可以直接通过@RequestParam映射参数获取
post的处理参考了下面这个哥们的博文,在此感谢!
参考链接
阅读全文
0 0
- bootstrap server分页
- bootstrap table分页采用server方式,分页查询
- bootstrap分页
- bootstrap分页
- Bootstrap 分页
- bootstrap分页
- Bootstrap 分页
- bootstrap-分页
- bootstrap 分页
- bootstrap分页
- BootStrap 分页
- bootstrap分页
- Bootstrap分页
- bootstrap 分页
- Bootstrap Table插件且是server端分页的问题
- Bootstrap分页插件--Bootstrap Paginator
- Bootstrap分页插件--Bootstrap Paginator
- bootstrap分页插件Bootstrap Paginator
- Rocketmq 配置双主双从
- TCP/IP协议
- 左右滑动弹出按钮,类似于QQ中,左右滑动消息框会弹出删除等按钮
- SuperFetch
- org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jst l/core cannot be re
- bootstrap server分页
- 云数据库MongoDB版使用教程
- erlang 数据结构 -- gb_trees
- python学习(十八)
- android intent传对象
- php获取a-z,A-Z,0-9的随机字符串
- LeetCode.118(119) Pascal's Triangle && II
- 译文: C28x Compiler Error and Warning Messages
- 如何使用自定义字体?@font-face