Pre Merge pull request !581 from yulee/master
This commit is contained in:
commit
65c95f5ebf
|
|
@ -595,7 +595,15 @@ var table = {
|
|||
hideAllColumns: function(tableId) {
|
||||
var currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
|
||||
$("#" + currentId).bootstrapTable('hideAllColumns');
|
||||
}
|
||||
},
|
||||
// 选中/取消选中表格某一行
|
||||
toggleCheck: function (index, checked, tableId) {
|
||||
let currentId = $.common.isEmpty(tableId) ? table.options.id : tableId;
|
||||
$("#" + currentId).bootstrapTable(
|
||||
checked ? 'check' : 'uncheck',
|
||||
index
|
||||
);
|
||||
},
|
||||
},
|
||||
// 表格树封装处理
|
||||
treeTable: {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@
|
|||
<a class="btn btn-primary" onclick="selectFirstColumns()">
|
||||
<i class="fa fa-search"></i> 获取选中首列值
|
||||
</a>
|
||||
<a class="btn btn-success" onclick="$.table.toggleCheck(1,true)">
|
||||
<i class="fa fa-check"></i> 选中第一行
|
||||
</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
|
|
@ -47,23 +50,23 @@
|
|||
checkbox: true
|
||||
},
|
||||
{
|
||||
field : 'userId',
|
||||
field : 'userId',
|
||||
title : '用户ID'
|
||||
},
|
||||
{
|
||||
field : 'userCode',
|
||||
field : 'userCode',
|
||||
title : '用户编号'
|
||||
},
|
||||
{
|
||||
field : 'userName',
|
||||
field : 'userName',
|
||||
title : '用户姓名'
|
||||
},
|
||||
{
|
||||
field : 'userPhone',
|
||||
field : 'userPhone',
|
||||
title : '用户手机'
|
||||
},
|
||||
{
|
||||
field : 'userEmail',
|
||||
field : 'userEmail',
|
||||
title : '用户邮箱'
|
||||
},
|
||||
{
|
||||
|
|
@ -91,12 +94,12 @@
|
|||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
|
||||
function selectColumns() {
|
||||
var column = $.table.selectColumns('userName');
|
||||
alert(column);
|
||||
}
|
||||
|
||||
|
||||
function selectFirstColumns() {
|
||||
var column = $.table.selectFirstColumns();
|
||||
alert(column);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user