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

Multiple grids in one view - gridStateService issue #190

Closed
AlexN2805 opened this issue Jun 14, 2019 · 2 comments
Closed

Multiple grids in one view - gridStateService issue #190

AlexN2805 opened this issue Jun 14, 2019 · 2 comments
Labels

Comments

@AlexN2805
Copy link

I'm submitting a Bug report

Your Environment

Software Version(s)
Aurelia-Slickgrid 2.10.1
TypeScript 2.9.2
Operating System Windows 10

Context

I currently have 2 slickgrids in the same view. I want to save both their states to the database. The problem however is that the gridStateService still seems to be a singular object. So only the state of the 2nd grid is saved correctly.

Expected Behavior

I expected that both grids have their own gridStateService, so both states can be saved.

Current Behavior

Only the 2nd grid saves it's state correctly. I've been testing some of the variables and the result was:
this.gridRequest.exportService === this.gridAvailability.exportService -> false
this.gridRequest.extensionService === this.gridAvailability.extensionService -> false
this.gridRequest.filterService === this.gridAvailability.filterService -> false
this.gridRequest.gridEventService === this.gridAvailability.gridEventService -> false
this.gridRequest.groupingService === this.gridAvailability.groupingService -> false
this.gridRequest.gridStateService === this.gridAvailability.gridStateService -> true
this.gridRequest.sortService === this.gridAvailability.sortService -> false
this.gridRequest.gridService === this.gridAvailability.gridService -> false

It seems that the gridStateService is shared amongst the 2 grid, causing this problem.

@ghiscoding
Copy link
Owner

Good catch, it seems we forgot to add the @singleton(true) on top of the Service like all other services, for example this line is for the GridService. I'll have to review all Services to make sure they are singleton

@ghiscoding
Copy link
Owner

@AlexN2805
This is now released under version 2.11.3

Up vote if you like the lib
Cheers ⭐️

@ghiscoding ghiscoding added the bug label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants