mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
Api: Fix Et2TreeDropdown lazy-load / initial load still conflicted after 2e469a00de
This commit is contained in:
parent
5be31ead6c
commit
f05c0880c0
@ -42,8 +42,23 @@ export type TreeItemData = SelectOption & {
|
|||||||
|
|
||||||
nocheckbox: number | Boolean,
|
nocheckbox: number | Boolean,
|
||||||
open: 0 | 1,
|
open: 0 | 1,
|
||||||
parent: String,
|
/**
|
||||||
text: String,
|
* @deprecated Use "value"
|
||||||
|
*/
|
||||||
|
id : string,
|
||||||
|
/**
|
||||||
|
* @deprecated No longer used, the nested data structure is used instead
|
||||||
|
*/
|
||||||
|
parent : string,
|
||||||
|
/**
|
||||||
|
* @deprecated Use "label"
|
||||||
|
*/
|
||||||
|
text : string,
|
||||||
|
/**
|
||||||
|
* @deprecated Use "children"
|
||||||
|
*/
|
||||||
|
item : object[],
|
||||||
|
|
||||||
tooltip: String,
|
tooltip: String,
|
||||||
userdata: any[]
|
userdata: any[]
|
||||||
//here we can store the number of unread messages, if there are any
|
//here we can store the number of unread messages, if there are any
|
||||||
@ -1028,7 +1043,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) implements Fin
|
|||||||
parentNode.open = false;
|
parentNode.open = false;
|
||||||
this.requestUpdate("lazy", "true");
|
this.requestUpdate("lazy", "true");
|
||||||
}
|
}
|
||||||
this.getDomNode(parentNode.id).loading = false
|
this.getDomNode(parentNode.id ?? parentNode.value).loading = false
|
||||||
this.requestUpdate("_selectOptions")
|
this.requestUpdate("_selectOptions")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -161,6 +161,17 @@ export class Et2TreeDropdown extends SearchMixin<Constructor<any> & Et2InputWidg
|
|||||||
document.addEventListener("click", this.handleDocumentClick);
|
document.addEventListener("click", this.handleDocumentClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
firstUpdated()
|
||||||
|
{
|
||||||
|
let options = this.multiple || !this.emptyLabel ? this.select_options : [{
|
||||||
|
value: "",
|
||||||
|
label: this.emptyLabel
|
||||||
|
}, ...this.select_options];
|
||||||
|
|
||||||
|
this._tree._selectOptions = <TreeItemData[]>options;
|
||||||
|
this._tree.requestUpdate("_selectOptions");
|
||||||
|
}
|
||||||
|
|
||||||
disconnectedCallback()
|
disconnectedCallback()
|
||||||
{
|
{
|
||||||
super.disconnectedCallback();
|
super.disconnectedCallback();
|
||||||
|
Loading…
Reference in New Issue
Block a user