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

Incorrect dataContext is passed in onSave callback using composite editor #1333

Closed
5 tasks done
rossmills99 opened this issue Dec 17, 2023 · 6 comments
Closed
5 tasks done

Comments

@rossmills99
Copy link

Describe the bug

The dataContext property (third argument of the onSave callback on CompositeEditorOpenDetailOption) has the values of an existing row from the grid, instead of containing the new values that were entered using the composite editor.

Reproduction

The dataContext appears to contain correct values after the first time of using it.

On the second and all subsequent attempts to use it, dataContext appears to contain the data of the row above/before the currently active cell of the grid.

Expectation

dataContext argument should contain the data that were entered in the composite editor dialog.

Environment Info

Angular ^16.2.0
angular-slickgrid ^6.6.4
@slickgrid-universal/composite-editor-component ^3.7.1

Validations

@ghiscoding
Copy link
Owner

I cannot reproduce this on my side, the Example 30 already has console log on the onSave and editing a single row (from Action menu "Edit Row" on the right), everything seems fine by me. Below is the live demo with editing 2nd row then 4th row and finally the 5th row, then you can see in the console that the data context is correct

image

Note that I have now published v7.0 a couple days ago and therefore I stopped supporting v6.x.

@rossmills99
Copy link
Author

I've reproduced using the demo page, here I've just added "Task 102" but the data context has "Task 99":

image

The issue occurs when creating new items in the grid, rather than editing existing items. I may be misinterpreting the purpose for the onSave arguments mind you - I was using dataContext because I do not see any values passed in the first argument (formValues), but perhaps the dataContext means something different than what I was expecting?

@ghiscoding
Copy link
Owner

ghiscoding commented Dec 18, 2023

ahhh ok I can take a look at the insert, I actually never used it even though I added the feature. I have Cypress test for that feature but only for 1 insert which is probably why I didn't catch this issue.

@rossmills99
Copy link
Author

Thanks for looking at that, and for the work you are open-sourcing with this project!

For my own use case, I think I will move away from using the composite editor and implement dialogs separately, just to have more control over the behaviour. The great thing is there sees to be plenty of flexibility to do that.

@ghiscoding
Copy link
Owner

I pushed a fix in Slickgrid-Universal as referenced in the link above, this will be released in a couple days but will only be available for v7.x since I don't want to support older versions of Angular-Slickgrid/Slickgrid-Universal (it's too much work for a sole developer like me on these open source projects)

ghiscoding added a commit that referenced this issue Dec 21, 2023
- fixes #1332, #1333
- possibly (and hopefully) fixes #1334 by using the new reimplementation of node-extend that is used for merging grid options and other sections of Slickgrid-Universal object merging & extending
ghiscoding added a commit that referenced this issue Dec 21, 2023
feat: reimplement highlight row, node-extend also fixes #1332, #1333
@ghiscoding
Copy link
Owner

closed by #1337

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

No branches or pull requests

2 participants