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

Cannot set selectionModel #927

Closed
b-giavotto opened this issue Nov 24, 2023 · 1 comment · Fixed by #928
Closed

Cannot set selectionModel #927

b-giavotto opened this issue Nov 24, 2023 · 1 comment · Fixed by #928

Comments

@b-giavotto
Copy link

b-giavotto commented Nov 24, 2023

this typescript code fails:

    let sm = new Slick.SlickRowSelectionModel();
    
    grid.setSelectionModel(sm);

the typescript compiler complain about incompatibility between Slick.SlickRowSelectionModel and the declared prototype of
setSelectionModel found in slick.grid.ts

setSelectionModel(model: SelectionModel) {
if (this.selectionModel) {
this.selectionModel.onSelectedRangesChanged.unsubscribe(this.handleSelectedRangesChanged.bind(this));
if (this.selectionModel.destroy) {
this.selectionModel.destroy();
}
}

Compiler output:

TS2345: Argument of type 'SlickRowSelectionModel' is not assignable to parameter of type 'SelectionModel'.
Type 'SlickRowSelectionModel' is not assignable to type '{ refreshSelections: () => void; onSelectedRangesChanged: SlickEvent<SlickRange[]>; getSelectedRanges: () => SlickRange[]; setSelectedRanges: (ranges: SlickRange[], caller?: string) => void; }'.
Types of property 'onSelectedRangesChanged' are incompatible.
Type 'SlickEvent<CellRange[]>' is not assignable to type 'SlickEvent<SlickRange[]>'.
Type 'CellRange[]' is not assignable to type 'SlickRange[]'.
Type 'CellRange' is missing the following properties from type 'SlickRange': isSingleRow, isSingleCell, contains

@ghiscoding
Copy link
Collaborator

ghiscoding commented Nov 25, 2023

it should be fixed in v5.5.5... high five ✋🏻

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

Successfully merging a pull request may close this issue.

2 participants