Bootstrap Table 实现列格式化显示
2018-01-15 17:58
302 查看
格式化使用函数formatter
例如:
详细使用如下:
例如:
formatter: function (value, row, index) { if (value == 'en') { return "英语"; } else { return "中文"; } }
详细使用如下:
var $table = $('#table').bootstrapTable({
url: '/fnd/message/query',
height: 460,
method: 'post',
search: true,
locale: 'zh-CN',
pagination: true,
sidePagination: 'server', // client or server
pageList: [10, 25, 50, 100],
showColumns: true,
showRefresh: true,
sortable: true,
contentType: 'application/x-www-form-urlencoded',
queryParams: queryParams,
toolbar: '#toolbar-btn',
columns: [{
field: 'state',
checkbox: true,
}, {
field: 'messageCode',
title: '<@spring.message "fnd.message_code"/>',
sortable: true,
width: 300,
editable: true
}, {
field: 'langCode',
title: '<@spring.message "fnd.lang_code"/>',
width: 150,
align: 'center',
editable: {
type: 'text',
title: '<@spring.message "fnd.lang_code"/>',
validate: function (v) {
if (!v) return '语言不能为空';
}
},
formatter: function (value, row, index) { if (value == 'en') { return "英语"; } else { return "中文"; } }
}, {
field: 'messageText',
title: '<@spring.message "fnd.message_text"/>',
editable: true
},],
});
相关文章推荐
- Bootstrap Table 实现简单的查询和显示功能
- bootstrap-table插件实现ajax服务端分页显示
- Bootstrap Table 实现简单的查询和显示功能
- BootStrap中Table隐藏后显示问题的实现代码
- Bootstrap-Table实现从服务器加载数据进行显示
- Bootstrap-Table实现从服务器加载数据进行显示
- Bootstrap-Table实现从服务器加载数据进行显示
- BootStrap Table实现server分页序号连续显示功能(当前页从上一页的结束序号开始)
- bootstrap 实现用 table 表格显示list数据
- Bootstrap Table 实现简单的查询和显示功能
- Bootstrap-Table实现从服务器加载数据进行显示
- 配合bootstrap实现的table 嵌套table
- 实现解析数据table表最后的点击显示更多数据的代码
- JavaScript和CSS通过expression实现Table居中显示
- JS组件Bootstrap Table表格多行拖拽效果实现代码
- qt利用委托:QStyledItemDelegate,实现tableview 的表格项的自定义显示,如插入图片,绘制控件
- jquery 实现 table 和 标题 的联动显示
- node和bootstrap-table实现最简单的服务端分页
- 级联两个bootstrap-table。一张表显示相关的数据,通过点击这张表的某一行,传过去对应的ID,刷新另外一张表。
- 实现TEXTAREA数据写入数据库后提取出来原样显示在网页TABLE上并自动换行