From b3c19e064d8c6f700d0255956deca0be39621eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Mon, 12 Jun 2023 14:58:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20table=20=E5=B1=80=E9=83=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index eac8bb55..0671dfd5 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -2127,20 +2127,20 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ // 事件返回的公共成员 var obj = { - tr: tr //行元素 - ,config: options - ,data: table.clearCacheKey(data) //当前行数据 - ,index: index - ,del: function(){ //删除行数据 + tr: tr, // 行元素 + config: options, + data: table.clearCacheKey(data), // 当前行数据 + index: index, + del: function(){ // 删除行数据 table.cache[that.key][index] = []; tr.remove(); that.scrollPatch(); - } - ,update: function(fields, related){ // 修改行数据 + }, + update: function(fields, related){ // 修改行数据 fields = fields || {}; layui.each(fields, function(key, value){ var td = tr.children('td[data-field="'+ key +'"]'); - var cell = td.children(ELEM_CELL); //获取当前修改的列 + var cell = td.children(ELEM_CELL); // 获取当前修改的列 // 更新缓存中的数据 data[key] = obj.data[key] = value;