-
-
Notifications
You must be signed in to change notification settings - Fork 202
Fix Grid Empty View Regression on Column Change #8993
Description
Problem
When dynamically changing the number of columns in Neo.grid.Container (e.g., in the Big Data example), the Grid Body sometimes renders as empty (<div id="grid-body"></div> with no children), even though Row components exist in memory and are actively updating.
Analysis
This is caused by a race condition or logic in onStoreLoad that clears vdom.cn (children references) but fails to repopulate them if me.items (Component instances) persists.
Specifically, createViewData iterates me.items and calls updateContent on them (triggering internal Row VDOM updates), but it assumes GridBody.vdom.cn still contains the references to these items. If vdom.cn was cleared (e.g., by a zero-item store load event or sync drift), GridBody.update() sends an empty child list to the VDOM worker, effectively detaching the rows from the DOM.
Solution
Implement a Self-Healing VDOM Strategy in GridBody.createViewData.
Instead of relying on stateful vdom.cn persistence, createViewData should explicitly rebuild vdom.cn from the active me.items during every render pass.
Logic:
- Clear
vdomRoot.cn = []before iterating rows. - Inside the loop, push
item.createVdomReference()tovdomRoot.cn.
This ensures the VDOM tree sent to the worker is always synchronized with the active Row components.
Impact
Restores robustness to Grid rendering, fixing the "Empty View" regression during column re-configuration and preventing similar desync issues.