Fix TypeError when toggling edit mode before Data Views grid loads#7819
Merged
Conversation
onEnableEditMode/onDisableEditMode called _getEditColumn().show()/.hide() without checking that the column exists, but the column is only created once the grid's async configuration request completes; enableEdit() invoked from an Ext.onReady handler on page load can win that race and throw before the grid is ready. Guard both calls with a null check, and source the edit column's initial hidden state from editMode instead of the constructor-time manageView snapshot so visibility stays correct once the column is created after a mode toggle.
…fb_dataViewsPanelRaceFix
labkey-gokhano
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
Toggling "Edit" on the Data Views webpart before its grid finishes its async configuration load throws
TypeError: can't access property "show", this._getEditColumn() is undefined, becauseonEnableEditMode/onDisableEditModecall.show()/.hide()on the edit column before it exists. This happens in practice when a page (e.g.project-begin.view) callsenableEdit()from anExt.onReadyhandler, which reliably wins the race against the panel's own config request.Prompted by this error on TeamCity:
Related Pull Requests
None.
Changes
onEnableEditMode/onDisableEditModebefore calling.show()/.hide().hiddenstate fromthis.editModeinstead of the constructor-timethis.manageViewsnapshot, so the column renders with the correct visibility once it's created after a mode toggle occurred first.