feat: add keepComponentAlive to all 4 framework Row Detail plugins#2653
feat: add keepComponentAlive to all 4 framework Row Detail plugins#2653ghiscoding wants to merge 9 commits into
keepComponentAlive to all 4 framework Row Detail plugins#2653Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2653 +/- ##
=======================================
Coverage 100.0% 100.0%
=======================================
Files 200 200
Lines 25325 25330 +5
Branches 8954 8954
=======================================
+ Hits 25325 25330 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
angular-slickgrid
aurelia-slickgrid
slickgrid-react
slickgrid-vue
@slickgrid-universal/angular-row-detail-plugin
@slickgrid-universal/aurelia-row-detail-plugin
@slickgrid-universal/react-row-detail-plugin
@slickgrid-universal/vue-row-detail-plugin
@slickgrid-universal/binding
@slickgrid-universal/common
@slickgrid-universal/composite-editor-component
@slickgrid-universal/custom-footer-component
@slickgrid-universal/custom-tooltip-plugin
@slickgrid-universal/empty-warning-component
@slickgrid-universal/event-pub-sub
@slickgrid-universal/excel-export
@slickgrid-universal/graphql
@slickgrid-universal/odata
@slickgrid-universal/pagination-component
@slickgrid-universal/pdf-export
@slickgrid-universal/row-detail-view-plugin
@slickgrid-universal/rxjs-observable
@slickgrid-universal/sql
@slickgrid-universal/text-export
@slickgrid-universal/utils
@slickgrid-universal/vanilla-bundle
@slickgrid-universal/vanilla-force-bundle
@slickgrid-universal/web-mcp
commit: |
|
@jr01 this might interest you since I know you are a user of Row Detail with Angular-Slickgrid... for reference, I asked copilot to see if the discussion opened in #2651 is fixable and this PR tries to fix those concerns by adding a new flag So I wouldn't mind your feedback on this PR if you have any special thoughts. Thanks |
keepComponentAlive to row detail plugin
keepComponentAlive to row detail pluginkeepComponentAlive to all frameworks Row Detail plugins
keepComponentAlive to all frameworks Row Detail pluginskeepComponentAlive to all 4 framework Row Detail plugins
|
Thanks @ghiscoding ), this looks really great!! I think the opt-in default is exactly right: it solves the RowDetail state-loss problem while preserving the existing memory-efficient behavior for large grids. I also like that an explicit collapse still destroys the component, and the viewport re-entry edge-case handling and regression tests. This gives us a clean path to use stateful RowDetail components (nested grids, forms, expensive initialization) without workarounds. No blockers from my side. Great work, and thanks! 💯 🥇 Looking forward to applying this. |
Adds
keepComponentAliveoption to preserve row detail component state when scrollingfixes #2651
Why Opt-In?
By default, row detail components are destroyed and recreated when scrolling out of viewport. This is memory-efficient for large datasets. However, this destroys component state (form input, nested grid filters, scroll position, etc.).
The new
keepComponentAliveflag enables keeping components alive in memory so state is preserved. It's opt-in by default (false) to maintain backward compatibility and avoid unexpected memory overhead for existing applications with large datasets.Changes
keepComponentAlive?: booleanoption toRowDetailViewOptioninterfaceApplicationRef.detachView()andattachView()rowDetailViewOptionsgetter now reads fromgetOptions()instead of stalegridOptions.rowDetailViewtryCatchWithReturnutility for consistent error handlingUse Cases
Enable
keepComponentAlivewhen you need to preserve component state:Trade-offs
References
Related to discussion: Row Detail Plugin - Official approach for rendering Angular components in v10.x (standalone)? · ghiscoding/slickgrid-universal · Discussion #2651