mirror of
https://gitee.com/layui/layui.git
synced 2025-05-17 21:49:37 +08:00
优化 treeTable 增加和删除节点时,对容器尺寸重新进行自动适配
This commit is contained in:
parent
f8fb29e300
commit
bd67afa744
@ -1243,6 +1243,9 @@ layui.define(['table'], function (exports) {
|
|||||||
tableView.find('tr[data-level="0"][lay-data-index="' + item4[LAY_DATA_INDEX] + '"]').attr('data-index', i4);
|
tableView.find('tr[data-level="0"][lay-data-index="' + item4[LAY_DATA_INDEX] + '"]').attr('data-index', i4);
|
||||||
})
|
})
|
||||||
options.hasNumberCol && formatNumber(that);
|
options.hasNumberCol && formatNumber(that);
|
||||||
|
|
||||||
|
// 重新适配尺寸
|
||||||
|
table.resize(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1384,6 +1387,10 @@ layui.define(['table'], function (exports) {
|
|||||||
// 滚动到第一个新增的节点
|
// 滚动到第一个新增的节点
|
||||||
tableViewElem.find(ELEM_MAIN).find('tr[lay-data-index="' + newNodes[0][LAY_DATA_INDEX] + '"]').get(0).scrollIntoViewIfNeeded();
|
tableViewElem.find(ELEM_MAIN).find('tr[lay-data-index="' + newNodes[0][LAY_DATA_INDEX] + '"]').get(0).scrollIntoViewIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 重新适配尺寸
|
||||||
|
table.resize(id);
|
||||||
|
|
||||||
return newNodes;
|
return newNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user