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

Variable for selectionType with Typescript is broken #2160

Open
elinake opened this issue Sep 6, 2023 · 0 comments
Open

Variable for selectionType with Typescript is broken #2160

elinake opened this issue Sep 6, 2023 · 0 comments

Comments

@elinake
Copy link

elinake commented Sep 6, 2023

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

With typescript it is not possible to use a variable in selectionType, because "undefined", or "null" are not valid values.

Expected behavior

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

  get selectionType(): SelectionType | undefined {
    return this.readOnly ? undefined  : SelectionType.checkbox;
  }

<ngx-datatable
  [selectionType]="selectionType"
>
</ngx-datatable>

This should be possible, but it is not.

Reproduction of the problem

Example plunker is not running at all so I can't reproduce the problem.

What is the motivation / use case for changing the behavior?

Nobody makes anything serious without typesafe code.

Please tell us about your environment:

  • Table version: 20.1.0
  • Angular version: 15.2.9
  • Browser: all
  • Language: TypeScript 4.9.4
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

1 participant