From f7e1dedac9e3085944842fff92c1c06f1b9e2121 Mon Sep 17 00:00:00 2001 From: nathan Date: Thu, 19 Oct 2023 16:11:12 -0600 Subject: [PATCH] Pass options on if sent from server --- .../Et2Nextmatch/Headers/CustomFilterHeader.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/api/js/etemplate/Et2Nextmatch/Headers/CustomFilterHeader.ts b/api/js/etemplate/Et2Nextmatch/Headers/CustomFilterHeader.ts index 701fe8fe7c..4868261612 100644 --- a/api/js/etemplate/Et2Nextmatch/Headers/CustomFilterHeader.ts +++ b/api/js/etemplate/Et2Nextmatch/Headers/CustomFilterHeader.ts @@ -3,6 +3,7 @@ import {Et2Select} from "../../Et2Select/Et2Select"; import {Et2InputWidget, Et2InputWidgetInterface} from "../../Et2InputWidget/Et2InputWidget"; import {FilterMixin} from "./FilterMixin"; import {html, LitElement} from "lit"; +import {cleanSelectOptions} from "../../Et2Select/FindSelectOptions"; /** * Filter by some other type of widget @@ -84,6 +85,20 @@ export class Et2CustomFilterHeader extends FilterMixin(Et2InputWidget(LitElement } } + /** + * New filter options from server + * @param new_options + */ + set_select_options(new_options) + { + const widget_class = window.customElements.get(this.filter_node?.localName); + const property = widget_class.getPropertyOptions('select_options'); + if(this.filter_node && property) + { + this.filter_node.select_options = cleanSelectOptions(new_options); + } + } + render() { return html`