From 81a8432429fa50c3d079a8aec4a571f90917d50d Mon Sep 17 00:00:00 2001 From: milan Date: Fri, 23 Feb 2024 08:53:13 +0100 Subject: [PATCH] fixed lazy calculation in Tree -- child == 1 and no item means lazy loading is needed --- api/js/etemplate/Et2Tree/Et2Tree.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Tree/Et2Tree.ts b/api/js/etemplate/Et2Tree/Et2Tree.ts index fe536f1528..e06b3900cb 100644 --- a/api/js/etemplate/Et2Tree/Et2Tree.ts +++ b/api/js/etemplate/Et2Tree/Et2Tree.ts @@ -661,7 +661,8 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) // Check to see if node is marked as open with no children. If autoloadable, load the children const expandState = (this.calculateExpandState(selectOption)); - const lazy = selectOption.item?.length === 0 && selectOption.child + // lazy iff "child" is set and "item" is empty or item does not exist in the first place + const lazy = (selectOption.item?.length === 0 && selectOption.child) || (selectOption.child && !selectOption.item) if(expandState && this.autoloading && lazy) { this.updateComplete.then(() =>