Skip to content

Allows for createPart to be used to craft parts to be utilized with withPart#428

Merged
BSd3v merged 6 commits intomainfrom
427-dash-ag-grid-v33-doesnt-support-withpart-for-theming-updates
Jan 6, 2026
Merged

Allows for createPart to be used to craft parts to be utilized with withPart#428
BSd3v merged 6 commits intomainfrom
427-dash-ag-grid-v33-doesnt-support-withpart-for-theming-updates

Conversation

@BSd3v
Copy link
Collaborator

@BSd3v BSd3v commented Dec 30, 2025

AG Grid is looking for a specific type when using the withPart, this allows a developer to create their own parts and configure properly for the grid to accept

@BSd3v BSd3v linked an issue Dec 30, 2025 that may be closed by this pull request
@AnnMarieW
Copy link
Collaborator

Should the js grid be imported automatically so you don't have to do it like this in all the apps?

app = Dash(
    external_scripts=[
            f'https://cdn.jsdelivr.net/npm/ag-grid-community@{dag.grid_version}/dist/ag-grid-community.min.js'
    ]
)

themeBalham,
themeMaterial,
themeQuartz,
createPart,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we already have ag-grid-community imported, it seems like we could avoid the requirement to download it as an external script by supplying it as context for the function?

import * as agGrid from 'ag-grid-community';

... 

const context = {
  ...themes,
  agGrid,
  d3,
  ...etc
};

Then, in the app:

dagfuncs.customTheme = (theme, agGrid) => {
    return theme.withPart(agGrid.createPart(agGrid.colorSchemeDark))
}

So basically, instead of cherry-picking createPart, we could just send over the entire agGrid api?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agGrid could be community or it could be enterprise.

The attempt was to reduce the component size by not bloating it with everything available but only pulling the necessary things out. Not sure what the impact of this would be.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It added 1kb, I could see it as worth it.

Copy link
Contributor

@KoolADE85 KoolADE85 left a comment

Choose a reason for hiding this comment

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

This works well on my end!

@BSd3v BSd3v merged commit a2b8d13 into main Jan 6, 2026
3 checks passed
@BSd3v BSd3v deleted the 427-dash-ag-grid-v33-doesnt-support-withpart-for-theming-updates branch January 6, 2026 21:49
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.

dash-ag-grid v33 doesn't support withPart for theming updates

3 participants