Is your feature request related to a problem? Please describe.
The Neo.table.Body component, which is non-buffered, was not optimized for cases where its connected store is cleared (e.g., via store.removeAll() or loading an empty dataset). When this happened with a table containing a large number of rows, the onStoreLoad method would call createViewData(), resulting in a full VDOM diff between all existing rows and the new empty state. While fast, this is an unnecessary operation that can be avoided.
Describe the solution you'd like
The onStoreLoad method in src/table/Body.mjs has been updated to include the same "fast path" optimization that was previously implemented for grid.Body.
The new logic is as follows:
- At the beginning of
onStoreLoad, it checks if the incoming data.items array from the load event is empty.
- If the array is empty and the table body currently has rows, it bypasses the standard
createViewData() call.
- Instead, it directly clears the internal VDOM array (
vdomRoot.cn = []), clears the VNode cache (me.getVnodeRoot().childNodes = []), and sends a single, direct delta to the main thread (Neo.applyDeltas(...)) to set the textContent of the table body to an empty string.
- If the incoming data is not empty, it proceeds with the standard
createViewData() call as before.
Benefits of this approach:
- Drastic Performance Improvement: Significantly reduces the time and CPU load required to clear a large table, making the UI feel more responsive.
- Code Consistency: Aligns the behavior of
table.Body with grid.Body, making the framework more consistent and predictable.
- Improved Efficiency: Avoids a large and unnecessary VDOM diffing operation for a common use case.
Is your feature request related to a problem? Please describe.
The
Neo.table.Bodycomponent, which is non-buffered, was not optimized for cases where its connected store is cleared (e.g., viastore.removeAll()or loading an empty dataset). When this happened with a table containing a large number of rows, theonStoreLoadmethod would callcreateViewData(), resulting in a full VDOM diff between all existing rows and the new empty state. While fast, this is an unnecessary operation that can be avoided.Describe the solution you'd like
The
onStoreLoadmethod insrc/table/Body.mjshas been updated to include the same "fast path" optimization that was previously implemented forgrid.Body.The new logic is as follows:
onStoreLoad, it checks if the incomingdata.itemsarray from theloadevent is empty.createViewData()call.vdomRoot.cn = []), clears the VNode cache (me.getVnodeRoot().childNodes = []), and sends a single, direct delta to the main thread (Neo.applyDeltas(...)) to set thetextContentof the table body to an empty string.createViewData()call as before.Benefits of this approach:
table.Bodywithgrid.Body, making the framework more consistent and predictable.