diff --git a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts index 737f0415b6..c0a6d7e8da 100644 --- a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts +++ b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts @@ -110,9 +110,17 @@ const Et2InputWidgetMixin = (superclass) => connectedCallback() { super.connectedCallback(); + this._oldChange = this._oldChange.bind(this); + this.addEventListener("change", this._oldChange); this.node = this.getInputNode(); } + disconnectedCallback() + { + super.disconnectedCallback(); + this.removeEventListener("change", this._oldChange); + } + /** * A property has changed, and we want to make adjustments to other things * based on that @@ -144,12 +152,8 @@ const Et2InputWidgetMixin = (superclass) => * @param _ev * @returns */ - _onChange(_ev : Event) : boolean + _oldChange(_ev : Event) : boolean { - if(typeof super._onChange == "function") - { - super._onChange(_ev); - } if(typeof this.onchange == 'function') { // Make sure function gets a reference to the widget, splice it in as 2. argument if not diff --git a/api/js/etemplate/et2_extension_nextmatch.ts b/api/js/etemplate/et2_extension_nextmatch.ts index 0b1fcfa729..8dc677930c 100644 --- a/api/js/etemplate/et2_extension_nextmatch.ts +++ b/api/js/etemplate/et2_extension_nextmatch.ts @@ -2185,6 +2185,10 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2 get_columns() { const colMgr = this.dataview.getColumnMgr(); + if(!colMgr) + { + return []; + } const visibility = colMgr.getColumnVisibilitySet(); const colDisplay = []; const custom_fields = []; @@ -3931,11 +3935,12 @@ export class et2_nextmatch_header_bar extends et2_DOMWidget implements et2_INext if(_widget.localName && window.customElements.get(_widget.localName) !== "undefined") { + // We could use addEventListener(), but callbacks expect these arguments // @ts-ignore _widget.onchange = (ev) => { return change.call(this, _widget, _widget); - } + }; } else {