mirror of https://github.com/layui/layui
新增 table `colTool` 事件,点击表头自定义元素触发,提升 table 的可玩性
parent
9d678a6be6
commit
3c8d20d23d
|
@ -1011,7 +1011,9 @@ a cite{font-style: normal; *cursor:pointer;}
|
|||
.layui-table-view .layui-table[lay-skin="row"]{border-width: 0; border-bottom-width: 1px;}
|
||||
.layui-table-view .layui-table th,
|
||||
.layui-table-view .layui-table td{padding: 0; border-top: none; border-left: none;}
|
||||
.layui-table-view .layui-table th [lay-event],
|
||||
.layui-table-view .layui-table th.layui-unselect .layui-table-cell span{cursor: pointer;}
|
||||
.layui-table-view .layui-table th span,
|
||||
.layui-table-view .layui-table td{cursor: default;}
|
||||
.layui-table-view .layui-table td[data-edit]{cursor: text;}
|
||||
.layui-table-view .layui-table td[data-edit]:hover:after{position: absolute; left: 0; top: 0; width: 100%; height: 100%; box-sizing: border-box; border: 1px solid #16B777; pointer-events: none; content: "";}
|
||||
|
|
|
@ -1948,6 +1948,21 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
|||
},{}));
|
||||
});
|
||||
|
||||
// 表头自定义元素事件
|
||||
that.layHeader.on('click', '*[lay-event]', function(e){
|
||||
var othis = $(this);
|
||||
var events = othis.attr('lay-event');
|
||||
var th = othis.closest('th');
|
||||
var key = th.data('key');
|
||||
var col = that.col(key);
|
||||
|
||||
layui.event.call(this, MOD_NAME, 'colTool('+ filter +')', $.extend({
|
||||
event: events,
|
||||
config: options,
|
||||
col: col
|
||||
},{}));
|
||||
});
|
||||
|
||||
// 分页栏操作事件
|
||||
that.layPagebar.on('click', '*[lay-event]', function(e){
|
||||
var othis = $(this);
|
||||
|
|
Loading…
Reference in New Issue