Et2SelectCategory: keep options sent from server

For example, addressbook index does this.
This commit is contained in:
nathan 2022-07-07 10:06:41 -06:00
parent e3b095dae7
commit 4936c0e043

View File

@ -57,11 +57,9 @@ export class Et2SelectCategory extends Et2Select
constructor() constructor()
{ {
super(); super();
this.select_options = so.cat(this);
} }
connectedCallback() async connectedCallback()
{ {
super.connectedCallback(); super.connectedCallback();
@ -72,6 +70,16 @@ export class Et2SelectCategory extends Et2Select
(this.getInstanceManager() && this.getInstanceManager().app) || (this.getInstanceManager() && this.getInstanceManager().app) ||
this.egw().app_name(); this.egw().app_name();
} }
// If app passes options (addressbook index) we'll use those instead.
// They will be found automatically by update() after ID is set.
await this.updateComplete;
if(this.select_options.length == 0)
{
so.cat(this).then(options =>
{
this.select_options = options
});
}
} }