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

Fix sub rows from overwriting the model cache of the parent #199

Merged
merged 1 commit into from Apr 27, 2016
Merged

Fix sub rows from overwriting the model cache of the parent #199

merged 1 commit into from Apr 27, 2016

Conversation

ghost
Copy link

@ghost ghost commented Apr 26, 2016

The modified line appears to be using the parent ID to recursively write each sub row into the model cache, overwriting the parent and possibly some of the sub rows. This in itself doesn't cause any issues, but if you try to use remove() on the parent ID after expanding a child row, instead of removing the parent (and all children) from the table, it removes the last item in the table, because the get() call in remove() will always return -1 from its indexOf() check - thus, causing a negative slice from the items array. Using the same reference as the indexById return the line below resolves the problem.

The modified line appears to be using the parent ID to recursively write each sub row into the model cache, overwriting the parent and possibly some of the sub rows. This in itself doesn't cause any issues, but if you try to use remove() on the parent ID after expanding a child row, instead of removing the parent (and all children) from the table, it removes the last item in the table, because the get() call in remove() will always return -1 from its indexOf() check - thus, causing a negative slice from the items array. Using the same reference as the indexById return the line below resolves the problem.
@EvHaus
Copy link
Owner

EvHaus commented Apr 27, 2016

Thanks for the PR @maverickjesus. I will include this in the 1.0.0-beta1 release. Let me know how that goes.

I'm not actively maintaining this project anymore. If you're using doby-grid in production and would like to become the owner of this repo, let me know and we can discuss it.

@EvHaus EvHaus merged commit 22c1297 into EvHaus:master Apr 27, 2016
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

Successfully merging this pull request may close these issues.

1 participant