Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGrid: Fix duplicate headers when headerCellTemplate is given (T1155453) #24531

Merged
merged 3 commits into from
May 11, 2023

Conversation

Alyar666
Copy link
Contributor

@Alyar666 Alyar666 commented May 4, 2023

@Alyar666 Alyar666 added the 22_2 label May 4, 2023
@Alyar666 Alyar666 requested a review from a team as a code owner May 4, 2023 23:44
@Alyar666 Alyar666 self-assigned this May 4, 2023
const { getInstance } = this;

return ClientFunction(
() => (getInstance() as any).option('grouping.autoExpandAll', false),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: can we use DataGrid type from our .d.ts instead of any here?

pomahtri
pomahtri previously approved these changes May 10, 2023
Comment on lines 246 to 252
_getContent: function(isFixedTableRendering) {
if(isFixedTableRendering) {
return this._fixedTableElement?.parent();
}

return this.callBase.apply(this, arguments);
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment.

Maybe the ternary operator will be better here?

Suggested change
_getContent: function(isFixedTableRendering) {
if(isFixedTableRendering) {
return this._fixedTableElement?.parent();
}
return this.callBase.apply(this, arguments);
},
_getContent: function(isFixedTableRendering) {
return isFixedTableRendering
? this._fixedTableElement?.parent()
: this.callBase.apply(this, arguments);
},

_removeContent: function(isFixedTableRendering) {
const $scrollContainer = this._getContent(isFixedTableRendering);

$scrollContainer?.length && $scrollContainer.remove();
Copy link
Contributor

@williamvinogradov williamvinogradov May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment.

Let's make this more obvious and add the if condition.
Also, it will help us in migration to TS because TS linter doesn't allow constructions like this :)

Suggested change
$scrollContainer?.length && $scrollContainer.remove();
if($scrollContainer?.length) {
$scrollContainer.remove();
}

@Alyar666 Alyar666 dismissed stale reviews from williamvinogradov and pomahtri via f2df7d8 May 11, 2023 09:18
@Alyar666 Alyar666 merged commit 109eefc into DevExpress:22_2 May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants