Browse Source

修复 treeTable `updateNode` 执行没有起作用的问题

pull/1247/head
sunxiaobin89 2 years ago
parent
commit
c6774f3874
  1. 2
      src/modules/treeTable.js

2
src/modules/treeTable.js

@ -323,6 +323,7 @@ layui.define(['table'], function (exports) {
var dataCache = table.cache[tableId][index]; var dataCache = table.cache[tableId][index];
if (newValue !== 'delete' && dataCache) { if (newValue !== 'delete' && dataCache) {
$.extend(dataCache, newValue);
return clone ? $.extend({}, dataCache) : dataCache; return clone ? $.extend({}, dataCache) : dataCache;
} }
@ -978,6 +979,7 @@ layui.define(['table'], function (exports) {
tableView.find('.layui-table-' + item + ' tbody tr[lay-data-index="' + index + '"]').replaceWith($(trNew[['trs', 'trs_fixed', 'trs_fixed_r'][i]].join('')).attr({ tableView.find('.layui-table-' + item + ' tbody tr[lay-data-index="' + index + '"]').replaceWith($(trNew[['trs', 'trs_fixed', 'trs_fixed_r'][i]].join('')).attr({
'data-index': trIndex, 'data-index': trIndex,
'lay-data-index': index, 'lay-data-index': index,
'data-level': trLevel
})); }));
}); });
that.renderTreeTable(tableView.find('tr[lay-data-index="' + index + '"]'), trLevel); that.renderTreeTable(tableView.find('tr[lay-data-index="' + index + '"]'), trLevel);

Loading…
Cancel
Save