Pass options on if sent from server

This commit is contained in:
nathan 2023-10-19 16:11:12 -06:00
parent 85cef367e2
commit f7e1dedac9

View File

@ -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`