From 57ff9a7db90c8c9aa5575de0d9532234bfcc0d07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?=
<3277200+sentsim@users.noreply.github.com>
Date: Tue, 20 Jun 2023 00:05:59 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20table=20=E7=BB=BC=E5=90=88?=
=?UTF-8?q?=E6=BC=94=E7=A4=BA=E4=B8=AD=E7=9A=84=E8=A1=A8=E5=A4=B4=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E4=BA=8B=E4=BB=B6=E7=A4=BA=E4=BE=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/table/examples/demo.md | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/docs/table/examples/demo.md b/docs/table/examples/demo.md
index 69da828d..b522f81b 100644
--- a/docs/table/examples/demo.md
+++ b/docs/table/examples/demo.md
@@ -82,7 +82,7 @@ layui.use(['table', 'dropdown'], function(){
{type: 'checkbox', fixed: 'left'},
{field:'id', fixed: 'left', width:80, title: 'ID', sort: true, totalRowText: '合计:'},
{field:'username', width:80, title: '用户'},
- {field:'email', title:'邮箱 ', fieldTitle: '邮箱', hide: 0, width:150, edit: 'text'},
+ {field:'email', title:'邮箱 ', fieldTitle: '邮箱', hide: 0, width:150, edit: 'text'},
{field:'sex', width:80, title: '性别', sort: true},
{field:'city', width:115, title: '城市', minWidth:115, templet: '#cityTpl', exportTemplet: function(d, obj){
// console.log(obj)
@@ -285,7 +285,18 @@ layui.use(['table', 'dropdown'], function(){
break;
};
});
-
+
+ // 表头自定义元素工具事件 --- 2.8.8+
+ table.on('colTool(test)', function(obj){
+ var event = obj.event;
+ console.log(obj);
+ if(event === 'email-tips'){
+ layer.alert(layui.util.escape(JSON.stringify(obj.col)), {
+ title: '当前列属性配置项'
+ });
+ }
+ });
+
// 触发单元格工具事件
table.on('tool(test)', function(obj){ // 双击 toolDouble
var data = obj.data; // 获得当前行数据