mirror of https://github.com/layui/layui
调整 treeTable 树形转平铺的方法保留节点的 `children` 信息
parent
50a0c0e4f7
commit
d49ad48c2b
|
@ -321,7 +321,6 @@ layui.define(['table'], function (exports) {
|
||||||
layui.each(tableData, function (i1, item1) {
|
layui.each(tableData, function (i1, item1) {
|
||||||
var dataIndex = (parentIndex ? parentIndex + '-' : '') + i1;
|
var dataIndex = (parentIndex ? parentIndex + '-' : '') + i1;
|
||||||
var dataNew = $.extend({}, item1);
|
var dataNew = $.extend({}, item1);
|
||||||
dataNew[childrenKey] = null;
|
|
||||||
dataNew[pIdKey] = item1[pIdKey] || parentId;
|
dataNew[pIdKey] = item1[pIdKey] || parentId;
|
||||||
flat.push(dataNew);
|
flat.push(dataNew);
|
||||||
flat = flat.concat(that.treeToFlat(item1[childrenKey], item1[customName.id], dataIndex));
|
flat = flat.concat(that.treeToFlat(item1[childrenKey], item1[customName.id], dataIndex));
|
||||||
|
|
Loading…
Reference in New Issue