fix(eventService): use grid.getOptions for gridDefinition #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a potential problem where the grid options as a parameter in the method are different than grid.getOptions. Users are allowed to change options after the grid is created by calling, for example,
grid.getOptions().showHeaderValue = false
. To make sure the options are up to date we need to callgrid.getOptions
when passing it as event args.Looking over
AureliaSlickgridCustomElement
, it should be fine to usethis.gridOptions
because most of the configuration is happening when the custom element is being created. The only potential issue I could see is if thedatasetChanged
fires after the grid is created. Then any call tothis.gridOptions
could potentially be out of data if the developer allows the user to change options later on. You can see this bug in example3 when you switchautoEdit
off and click the "edit" button. The gridDefinition hasautoEdit=true
when it should be falseI was not sure if you wanted to use
args.grid
or just thegrid
param because I see you use both so I just picked one.closes #49