|
|
@ -1265,6 +1265,7 @@ layui.define(['table'], function (exports) {
|
|
|
|
var options = that.getOptions();
|
|
|
|
var options = that.getOptions();
|
|
|
|
var treeOptions = options.tree;
|
|
|
|
var treeOptions = options.tree;
|
|
|
|
var tableViewElem = options.elem.next();
|
|
|
|
var tableViewElem = options.elem.next();
|
|
|
|
|
|
|
|
var checkName = table.config.checkName;
|
|
|
|
|
|
|
|
|
|
|
|
opts = opts || {};
|
|
|
|
opts = opts || {};
|
|
|
|
|
|
|
|
|
|
|
@ -1280,6 +1281,13 @@ layui.define(['table'], function (exports) {
|
|
|
|
// 添加数据
|
|
|
|
// 添加数据
|
|
|
|
newNodes = $.extend(true, [], (layui.isArray(newNodes) ? newNodes : [newNodes]));
|
|
|
|
newNodes = $.extend(true, [], (layui.isArray(newNodes) ? newNodes : [newNodes]));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 若未传入 LAY_CHECKED 属性,则继承父节点的 checked 状态
|
|
|
|
|
|
|
|
layui.each(newNodes, function(i, item){
|
|
|
|
|
|
|
|
if(!(checkName in item)){
|
|
|
|
|
|
|
|
item[checkName] = parentNode[checkName];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
var tableData = that.getTableData(), dataAfter;
|
|
|
|
var tableData = that.getTableData(), dataAfter;
|
|
|
|
if (!parentNode) {
|
|
|
|
if (!parentNode) {
|
|
|
|
// 添加到根节点
|
|
|
|
// 添加到根节点
|
|
|
|