Skip to content

Commit 9dbe7b0

Browse files
committed
Allows for createPart to be used to craft parts to be utilized with withPart
1 parent c87759d commit 9dbe7b0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/lib/fragments/AgGrid.react.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
themeBalham,
4848
themeMaterial,
4949
themeQuartz,
50+
createPart,
5051
} from 'ag-grid-community';
5152
const themes = {themeAlpine, themeBalham, themeMaterial, themeQuartz};
5253

@@ -157,6 +158,7 @@ export function DashAgGrid(props) {
157158
esprima.parse(funcString).body[0].expression;
158159
const context = {
159160
...themes,
161+
createPart,
160162
d3,
161163
dash_clientside,
162164
...customFunctions,
@@ -175,6 +177,7 @@ export function DashAgGrid(props) {
175177
esprima.parse(funcString).body[0].expression;
176178
const context = {
177179
...themes,
180+
createPart,
178181
d3,
179182
dash_clientside,
180183
...customFunctions,
@@ -195,6 +198,7 @@ export function DashAgGrid(props) {
195198
esprima.parse(funcString).body[0].expression;
196199
const context = {
197200
...themes,
201+
createPart,
198202
d3,
199203
...customFunctions,
200204
...window.dashAgGridFunctions,

tests/assets/dashAgGridFunctions.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,3 +539,6 @@ dagfuncs.testToyota = (params) => {
539539
return params.data.make == 'Toyota' ? {'color': 'blue'} : {}
540540
}
541541

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

0 commit comments

Comments
 (0)