diff --git a/api/js/etemplate/Et2Tree/Et2TreeDropdown.ts b/api/js/etemplate/Et2Tree/Et2TreeDropdown.ts index e7ac978802..6ce02535ff 100644 --- a/api/js/etemplate/Et2Tree/Et2TreeDropdown.ts +++ b/api/js/etemplate/Et2Tree/Et2TreeDropdown.ts @@ -398,14 +398,14 @@ export class Et2TreeDropdown extends Et2WidgetWithSelectMixin(LitElement) */ protected iconTemplate(option) { - if(!option.icon) + if(!option.icon && !option.im0) { return html``; } return html` ` + src="${option.icon ?? option.im0}">` } inputTemplate() diff --git a/api/src/Etemplate/Widget/Tree.php b/api/src/Etemplate/Widget/Tree.php index 783ff6ce4d..66fd665030 100644 --- a/api/src/Etemplate/Widget/Tree.php +++ b/api/src/Etemplate/Widget/Tree.php @@ -539,6 +539,7 @@ class Tree extends Etemplate\Widget */ 'value' => $cat['id'], 'label' => $s, + 'icon' => $cat['data']['icon'] ?: '', 'title' => $cat['description'] ); $cat_id_list[] = $cat['id'];