EvHaus / doby-grid

An HTML table element on steroids.
Other
14 stars 5 forks source link

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

Closed ghost closed 8 years ago

ghost commented 8 years ago

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 commented 8 years ago

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.