优化 treeTable 异步加载字节点为空时的展开状态

解决异步加载数据没有子节点数据双点行展开已展开的所有节点问题
pull/1344/head
贤心 2023-08-23 22:39:59 +08:00 committed by GitHub
commit 0f3142085e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -574,6 +574,7 @@ layui.define(['table'], function (exports) {
if (trExpand) {
// 展开
if (trExpanded) { // 已经展开过
if (!childNodes.length) return ;//异步如果子节点没有数据情况下双点行展开所有已展开的节点问题解决
trsElem.nextAll(childNodes.map(function (value, index, array) {
return 'tr[lay-data-index="' + value[LAY_DATA_INDEX] + '"]'
}).join(',')).removeClass(HIDE);