mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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;
|
||||
}
|
||||
|
||||
const prom = this.sortColumn
|
||||
? sortData(
|
||||
filteredData,
|
||||
this._sortColumns[this.sortColumn],
|
||||
this.sortDirection,
|
||||
this.sortColumn,
|
||||
this.hass.locale.language
|
||||
)
|
||||
: filteredData;
|
||||
const prom =
|
||||
this.sortColumn && this._sortColumns[this.sortColumn]
|
||||
? sortData(
|
||||
filteredData,
|
||||
this._sortColumns[this.sortColumn],
|
||||
this.sortDirection,
|
||||
this.sortColumn,
|
||||
this.hass.locale.language
|
||||
)
|
||||
: filteredData;
|
||||
|
||||
const [data] = await Promise.all([prom, nextRender]);
|
||||
|
||||
|
@ -260,10 +260,11 @@ export class HaTabsSubpageDataTable extends KeyboardShortcutMixin(LitElement) {
|
||||
<ha-assist-chip
|
||||
slot="trigger"
|
||||
.label=${localize("ui.components.subpage-data-table.sort_by", {
|
||||
sortColumn: this._sortColumn
|
||||
? ` ${this.columns[this._sortColumn]?.title || this.columns[this._sortColumn]?.label}` ||
|
||||
""
|
||||
: "",
|
||||
sortColumn:
|
||||
this._sortColumn && this.columns[this._sortColumn]
|
||||
? ` ${this.columns[this._sortColumn].title || this.columns[this._sortColumn].label}` ||
|
||||
""
|
||||
: "",
|
||||
})}
|
||||
>
|
||||
<ha-svg-icon
|
||||
|
Loading…
x
Reference in New Issue
Block a user