mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix data-table sort by unknown column (#24965)
Fix database sort by unknown column
This commit is contained in:
parent
13aeb02b53
commit
9df5141aac
@ -645,15 +645,16 @@ export class HaDataTable extends LitElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const prom = this.sortColumn
|
const prom =
|
||||||
? sortData(
|
this.sortColumn && this._sortColumns[this.sortColumn]
|
||||||
filteredData,
|
? sortData(
|
||||||
this._sortColumns[this.sortColumn],
|
filteredData,
|
||||||
this.sortDirection,
|
this._sortColumns[this.sortColumn],
|
||||||
this.sortColumn,
|
this.sortDirection,
|
||||||
this.hass.locale.language
|
this.sortColumn,
|
||||||
)
|
this.hass.locale.language
|
||||||
: filteredData;
|
)
|
||||||
|
: filteredData;
|
||||||
|
|
||||||
const [data] = await Promise.all([prom, nextRender]);
|
const [data] = await Promise.all([prom, nextRender]);
|
||||||
|
|
||||||
|
@ -260,10 +260,11 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
|
|||||||
<ha-assist-chip
|
<ha-assist-chip
|
||||||
slot="trigger"
|
slot="trigger"
|
||||||
.label=${localize("ui.components.subpage-data-table.sort_by", {
|
.label=${localize("ui.components.subpage-data-table.sort_by", {
|
||||||
sortColumn: this._sortColumn
|
sortColumn:
|
||||||
? ` ${this.columns[this._sortColumn]?.title || this.columns[this._sortColumn]?.label}` ||
|
this._sortColumn && this.columns[this._sortColumn]
|
||||||
""
|
? ` ${this.columns[this._sortColumn].title || this.columns[this._sortColumn].label}` ||
|
||||||
: "",
|
""
|
||||||
|
: "",
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<ha-svg-icon
|
<ha-svg-icon
|
||||||
|
Loading…
x
Reference in New Issue
Block a user