Open schnucks-rrphillips opened 4 years ago
The same problem here Table version: "@swimlane/ngx-datatable": "16.0.2"
Angular version: Version 8.2.14
TypeScript version: TypeScript 3.5.3
How to fixed?
I got it to work in ng9 strict mode by importing SelectionType...
import {DatatableComponent, SelectionType} from '@swimlane/ngx-datatable';
And using this syntax...
[selectionType]="SelectionType.checkbox"
Import it import { SelectionType } from '@swimlane/ngx-datatable';
Declare it
selection: SelectionType;
initialize it constructor() { this.selection = SelectionType.checkbox; };
<ngx-datatable class="material" [rows]="deviceConfigList" [columnMode]="'force'" [headerHeight]="42" [footerHeight]="30" [sorts]="[{prop: 'deviceFunction', dir: 'asc'}]" [rowHeight]="75" [scrollbarV]="true" [selected]="selected" [selectionType]="'checkbox'" (select)='onSelect($event)'>
I'm submitting a ... (check one with "x")
Current behavior For the above code Angular 9 running in strict mode reports the type error: "Type '"checkbox"' is not assignable to type 'SelectionType'." Also, IntelliJ IDE detects the same error. As a result I cannot build this app in strict mode. It builds with fullTemplateTypeCheck enabled. The UI works as expected with this syntax.
Table version: "@swimlane/ngx-datatable": "^17.0.0"
Angular version: Version 9.1.2
TypeScript version: TypeScript 3.8.3