Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type "checkbox" is not assignable to type SelectionType #1873

Open
schnucks-rrphillips opened this issue Apr 24, 2020 · 3 comments
Open

Type "checkbox" is not assignable to type SelectionType #1873

schnucks-rrphillips opened this issue Apr 24, 2020 · 3 comments

Comments

@schnucks-rrphillips
Copy link

<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")

[X ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

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

@ceoaliongroo
Copy link

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?

@schnucks-rrphillips
Copy link
Author

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"

@vinayakshedgeri
Copy link

Import it
import { SelectionType } from '@swimlane/ngx-datatable';

Declare it

  selection: SelectionType;

initialize it
constructor() {
this.selection = SelectionType.checkbox;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants