mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 18:56:39 +00:00
parent
81e4f083f9
commit
e242fbe148
@ -200,7 +200,6 @@ export class HaDataTable extends LitElement {
|
|||||||
Object.values(clonedColumns).forEach(
|
Object.values(clonedColumns).forEach(
|
||||||
(column: ClonedDataTableColumnData) => {
|
(column: ClonedDataTableColumnData) => {
|
||||||
delete column.title;
|
delete column.title;
|
||||||
delete column.type;
|
|
||||||
delete column.template;
|
delete column.template;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -55,11 +55,16 @@ const sortData = (
|
|||||||
? b[column.valueColumn || sortColumn][column.filterKey]
|
? b[column.valueColumn || sortColumn][column.filterKey]
|
||||||
: b[column.valueColumn || sortColumn];
|
: b[column.valueColumn || sortColumn];
|
||||||
|
|
||||||
if (typeof valA === "string") {
|
if (column.type === "numeric") {
|
||||||
valA = valA.toUpperCase();
|
valA = isNaN(valA) ? undefined : Number(valA);
|
||||||
}
|
valB = isNaN(valB) ? undefined : Number(valB);
|
||||||
if (typeof valB === "string") {
|
} else {
|
||||||
valB = valB.toUpperCase();
|
if (typeof valA === "string") {
|
||||||
|
valA = valA.toUpperCase();
|
||||||
|
}
|
||||||
|
if (typeof valB === "string") {
|
||||||
|
valB = valB.toUpperCase();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure "undefined" is always sorted to the bottom
|
// Ensure "undefined" is always sorted to the bottom
|
||||||
|
Loading…
x
Reference in New Issue
Block a user