Hi all,
my template is defined as follows:
<c8y-device-grid [title]="'Devices'" [columns]="columns" [actionControls]="[]"
(itemsSelect)="onItemsSelect($event)" [selectable]="true"
(onDeviceQueryStringChange)="onDeviceQueryStringChange($event)"></c8y-device-grid>
but when trying to apply a filter to the column type it is not taking any effect. Please see the following screenshot:
I use “@c8y/ngx-components”: “1023.17.6”.
Applying filters to the other columns works.
What do I have to change to apply filters to the column type?
Regards Christof
Hi Christof,
can you share how you’ve defined the type column in your columns array?
Regards,
Tristan
Hi Tristian,
I’ve managed to get the search working by switching to a predefined column type.
The Fix: Instead of an inline object, I’m now using the existing TypeDeviceGridColumn class:
getColumns(): Column[] {
const cols: Column[] = [
new NameDeviceGridColumn(),
new GroupDeviceGridColumn(),
new RegistrationDateDeviceGridColumn(),
new SystemIdDeviceGridColumn(),
new TypeDeviceGridColumn()
// {
// header: 'Type',
// name: 'type',
// path: 'type',
// filterable: true,
// sortable: true,
// dataType: ColumnDataType.TextShort,
// },
];
return cols;
}
Observation: Interestingly, while the inline object definition (using ColumnDataType.TextShort) works perfectly in a <c8y-data-grid>, it failed to return search results in the <c8y-device-grid>.
Is using the specialized column classes the intended way to handle this for Device Grids, or should the inline definition technically be supported there as well?
Regards Christof
1 Like