mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
fix getValue()
This commit is contained in:
parent
317f2fdbb9
commit
0287ce0e0d
@ -347,7 +347,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
|
|||||||
*/
|
*/
|
||||||
public getSelectedItem(): TreeItemData
|
public getSelectedItem(): TreeItemData
|
||||||
{
|
{
|
||||||
return this._currentOption || this._selectOptions[0]
|
return this._currentOption || (this._selectOptions ? this._selectOptions[0] : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -356,17 +356,19 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
|
|||||||
*/
|
*/
|
||||||
getValue()
|
getValue()
|
||||||
{
|
{
|
||||||
if(this.multiple){
|
if(this.multiple)
|
||||||
let res:string[] = []
|
{
|
||||||
if(this.selectedNodes?.length)
|
let res:string[] = [];
|
||||||
for (const selectedNode of this.selectedNodes)
|
if(this.selectedNodes?.length)
|
||||||
{
|
{
|
||||||
res.push(selectedNode.id)
|
for (const selectedNode of this.selectedNodes)
|
||||||
|
{
|
||||||
|
res.push(selectedNode.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return res}
|
return res;
|
||||||
else {
|
|
||||||
this.getSelectedItem().id
|
|
||||||
}
|
}
|
||||||
|
return this.getSelectedItem()?.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user