bootstrap table 服务端
2015-07-14 11:53
633 查看
//初始化用户列表 $("#usergroud").bootstrapTable({ method: 'post', url: '/Wx_UserGroup/GetUserInfo', cache: false, height: 600, striped: true, pagination: true, pageSize: 20, pageList: [20, 40, 60, 80, 200], search: false, showColumns: false, showRefresh: false, minimumCountColumns: 2, clickToSelect: false, sidePagination: "server", dataType: "jsonp", //dataType: "json", queryParams: function (e) { var param = { PageSize: e.limit, PageIndex: (e.offset / e.limit) + 1, }; return param; }, responseHandler: function (e) { if (e.data && e.data.Rows && e.data.Rows.length > 0) { return { rows: e.data.Rows, total: e.data.Total }; } else { return { "rows": [], "total": 0 }; } }, columns: [{ field: 'Id', checkbox: true, visible: true }, { field: 'pic', title: '头像', align: 'center', sortable: true, clickToSelect: false, formatter: imageFormatter }, { field: 'name', title: '姓名', align: 'center', sortable: true, clickToSelect: false }, { field: 'sex', title: '性别', align: 'center', sortable: true, clickToSelect: false, formatter: sexFormatter }, { field: 'addr', title: '地址', align: 'center', sortable: true, clickToSelect: false }, { field: 'group', title: '分组', align: 'center', clickToSelect: false //events: operateEvents }] }).on('page-change.bs.table', function (e, size, number) { //console.log(size, number) }); }); function imageFormatter(value, row, index) { return "<img src='" + value + "' style='width:50px; height:50px;' />"; } function sexFormatter(value, row, index) { return value == 1 ? "男" : "女"; }
相关文章推荐
- bootstrap js插件篇——下拉菜单、滚动监测、选项卡
- bootstrap js插件篇——动画过渡、模态弹窗
- 20分钟打造你的Bootstrap站点
- bootstrap 基础知识学习(列表+表格)
- bootstrap 基础知识(表单)
- 解决bootstrap的tooltip插件不能自动定位不是相对于浏览器窗口定位的问题
- bootstrap 基础知识学习(图片+网格系统)
- bootstrap Modal的简单笔记
- bootstrap-datetimepicker使用记录
- Bootstrap – 1.认识
- Bootstrap总结(一)
- 机器学习技法总结(四)(aggregation,vote,bootstrap...)
- bootstrap 动态添加验证项和取消验证项
- bootstrap基础知识学习(下拉菜单+按钮)
- Bootstrap.initClassLoaders
- Bootstrap.init
- Bootstrap.main
- bootstrap 基础知识学习(导航+其他)
- Bootstrap 模态对话框只加载一次 remote 数据的解决办法
- html + Bootstrap