diff --git a/api/js/etemplate/Et2Tree/Et2Tree.ts b/api/js/etemplate/Et2Tree/Et2Tree.ts index 8c2b6df0f6..a5e25184fd 100644 --- a/api/js/etemplate/Et2Tree/Et2Tree.ts +++ b/api/js/etemplate/Et2Tree/Et2Tree.ts @@ -151,7 +151,6 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) // Actions can't be initialized without being connected to InstanceManager this._initActions(); - //TODO do it on first updated this._link_actions(this.actions) } @@ -163,6 +162,11 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) //Sl-Trees handle their own onClick events _handleClick(_ev) { + //if onclick is defined, and we have a resonable target (e.g. one single item that was clicked on, trigger the onclick function + if (typeof this.onclick == "function" && typeof _ev.target.value == "string") + { + this.onclick(_ev.target.value, this, _ev.target.value) + } } static get styles()