Bootstrap Table使用整理(四)之工具栏
网络编程 2021-07-04 18:32www.168986.cn编程入门
这篇文章主要介绍了Bootstrap Table使用整理(四)之工具栏的相关资料,需要的朋友可以参考下
相关阅读:
Bootstrap Table使用整理(一)
Bootstrap Table使用整理(二)
Bootstrap Table使用整理(三)
Bootstrap Table使用整理(五)之分页组合查询
一、启用默认支持的工具栏
/* * data-search 是否显示搜索框 * data-show-refresh 是否像是刷新按钮,注:刷新操作会重新请求数据,并带着请求参数 * data-show-toggle 是否显示面板切换按钮 * data-show-columns 是否显示列控制按钮 */ $('#table1').bootstrapTable({ columns: [ { field: 'sno', title: '学生编号' }, { field: 'sname', title: '学生姓名' }, { field: 'ssex', title: '性别' }, { field: 'sbirthday', title: '生日' }, { field: 'class', title: '课程编号' }, ], url:'@Url.Action("GetStudent","DataOne")' }); <table id="table1" data-classes="table table-hover " data-search="true" data-show-refresh="true" data-show-toggle="true" data-show-columns="true"></table>
二、扩展工具栏使用
/* * data-toolbar 用于指定id的div扩展工具栏,这种方式类似EaseUI中的datagird * queryParams 请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果 queryParamsType = 'limit' ,返回参数必须包含 limit, offset, search, sort, order 否则, 需要包含: pageSize, pageNumber, searchText, sortName, sortOrder. 返回false将会终止请求 */ var $table1= $('#table1').bootstrapTable({ columns: [ { field: 'sno', title: '学生编号' }, { field: 'sname', title: '学生姓名' }, { field: 'ssex', title: '性别' }, { field: 'sbirthday', title: '生日' }, { field: 'class', title: '课程编号' }, ], url: '@Url.Action("GetStudent","DataOne")', queryParams: function (params) { params.name = '张三丰'; //特别说明,返回的参数的值为空,则当前参数不会发送到服务器端 params.sex = $('input[name="sex"]:checked').val(); return params; } }); //刷新方法 $('#heartBtn').click(function () { ////刷新处理,指定query 的参数,注:此地方指定的参数,仅在当次刷新时使用 //$table1.bootstrapTable('refresh', { // query: { // name: '张三' // } /
编程语言
- 机械手焊接机器人编程 机械手焊接设备编程
- vb数据库编程实例,vb做数据库
- tiobe世界编程语言排行榜,全球编程语言排行
- 成都java编程培训 成都it编程培训中心
- 编程基础培训,编程基础知识培训
- flash游戏编程基础教程,flash游戏开发教程
- 不会英语能学编程吗 不会英语可以学程序员吗
- 爱心代码编程C语言 爱心代码编程c语言公式
- c语言编程学习入门 c语言编程快速入门
- 西门子plc编程培训 西门子plc编程培训班
- 哪里可以学编程 台州哪里可以学编程
- 少儿编程哪个好 少儿编程哪个品牌好
- 编程是什么意思,图形编程是什么意思
- c语言编程软件下载,c语言编程软件在哪下载
- java编程软件下载,java编程下载手机版
- ug编程培训学校,ug编程培训教程