mirror of
https://gitee.com/layui/layui.git
synced 2025-04-05 17:38:02 +08:00
fix(treeTable): 修复 treeToFlat 改变根节点 pid 问题 (#2526)
This commit is contained in:
parent
08ccd5a729
commit
242c94f57c
@ -387,7 +387,8 @@ layui.define(['table'], function (exports) {
|
||||
layui.each(tableData, function (i1, item1) {
|
||||
var dataIndex = (parentIndex ? parentIndex + '-' : '') + i1;
|
||||
var dataNew = $.extend({}, item1);
|
||||
dataNew[pIdKey] = item1[pIdKey] || parentId;
|
||||
|
||||
dataNew[pIdKey] = typeof item1[pIdKey] !== 'undefined' ? item1[pIdKey] : parentId;
|
||||
flat.push(dataNew);
|
||||
flat = flat.concat(that.treeToFlat(item1[childrenKey], item1[customName.id], dataIndex));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user