Skip to content

PivotGrid: restore Field Panel operations after dataSource reassignment#33136

Closed
nightskylark wants to merge 2 commits into
26_1from
fix/pivotgrid-visual-range
Closed

PivotGrid: restore Field Panel operations after dataSource reassignment#33136
nightskylark wants to merge 2 commits into
26_1from
fix/pivotgrid-visual-range

Conversation

@nightskylark
Copy link
Copy Markdown
Contributor

PR Title
PivotGrid: restore Field Panel operations after dataSource reassignment

PR Description
This PR fixes a regression where Field Panel interactions stop working after dataSource is reassigned (for example: initialize with dataSource: null, then set a new PivotGridDataSource).

Root cause

  • On dataSource change, PivotGrid called _fieldChooserBase._dispose().
  • The disposed dxPivotGridFieldChooserBase instance stayed attached to the element.
  • On next render, _createComponent(...) reused that stale instance, so Field Panel logic (groupFilter, sorting, header filter) still referenced the old data source.

What was changed

  • Added _disposeFieldChooserBase() in m_widget.ts to fully clean up FieldChooserBase:
  1. call _dispose()
  2. remove the instance from element data
  3. remove the component name from dxComponents
  4. reset _fieldChooserBase reference
  • Replaced direct _fieldChooserBase._dispose() calls with _disposeFieldChooserBase().

Tests

  • Added regression test: Field panel operations should work after dataSource reassignment.
  • The test verifies:
  1. Field Panel group is valid for drag-and-drop (groupFilter === true)
  2. sorting from Field Panel updates current data source state
  3. header filter opens with items

@nightskylark nightskylark deleted the fix/pivotgrid-visual-range branch April 2, 2026 13:31
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