diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html
index c2d1997945..1c53c602b4 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.html
@@ -41,7 +41,7 @@
- {{ column.title }}
+ {{ column.title }}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts
index f4429fb4cc..ed0aea1bd1 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts
@@ -346,6 +346,7 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
label: 'entityName',
def: 'entityName',
title: entityNameColumnTitle,
+ sortable: true,
entityKey: {
key: 'name',
type: EntityKeyType.ENTITY_FIELD
@@ -369,6 +370,7 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
label: 'entityLabel',
def: 'entityLabel',
title: entityLabelColumnTitle,
+ sortable: true,
entityKey: {
key: 'label',
type: EntityKeyType.ENTITY_FIELD
@@ -392,6 +394,7 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
label: 'entityType',
def: 'entityType',
title: this.translate.instant('entity.entity-type'),
+ sortable: true,
entityKey: {
key: 'entityType',
type: EntityKeyType.ENTITY_FIELD
@@ -425,6 +428,7 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni
dataKey.label = this.utils.customTranslation(dataKey.label, dataKey.label);
dataKey.title = dataKey.label;
dataKey.def = 'def' + this.columns.length;
+ dataKey.sortable = !dataKey.usePostProcessing;
const keySettings: TableWidgetDataKeySettings = dataKey.settings;
if (dataKey.type === DataKeyType.entityField &&
!isDefined(keySettings.columnWidth) || keySettings.columnWidth === '0px') {
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts
index f90c287111..1d798a88ca 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts
@@ -73,6 +73,7 @@ export interface EntityData {
export interface EntityColumn extends DataKey {
def: string;
title: string;
+ sortable: boolean;
entityKey?: EntityKey;
}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html
index 6e37d38762..4f193a6cd7 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html
@@ -52,7 +52,7 @@
- {{ h.dataKey.label }}
+ {{ h.dataKey.label }}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts
index 07d35a1405..430646fc06 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts
@@ -91,6 +91,7 @@ interface TimeseriesRow {
interface TimeseriesHeader {
index: number;
dataKey: DataKey;
+ sortable: boolean;
}
interface TimeseriesTableSource {
@@ -325,10 +326,12 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI
for (let a = 0; a < datasource.dataKeys.length; a++ ) {
const dataKey = datasource.dataKeys[a];
const keySettings: TableWidgetDataKeySettings = dataKey.settings;
+ const sortable = !dataKey.usePostProcessing;
const index = a + 1;
source.header.push({
index,
- dataKey
+ dataKey,
+ sortable
});
source.displayedColumns.push(index + '');
source.rowDataTemplate[dataKey.label] = null;