@@ -46,7 +46,7 @@ import MarkdownRenderer from '../renderers/markdownRenderer';
4646import RowMenuRenderer from '../renderers/rowMenuRenderer' ;
4747import { customFunctions } from '../renderers/customFunctions' ;
4848
49- import { AgGridReact } from 'ag-grid-react' ;
49+ import { AgGridReact , useGridFilter } from 'ag-grid-react' ;
5050
5151import 'ag-grid-community/styles/ag-grid.css' ;
5252import 'ag-grid-community/styles/ag-theme-alpine.css' ;
@@ -488,7 +488,10 @@ export default class DashAgGrid extends Component {
488488 if ( target === 'getRowId' ) {
489489 return this . convertFunction ( value ) ;
490490 }
491- if ( target === 'getRowStyle' ) {
491+ if (
492+ target === 'getRowStyle' &&
493+ ( has ( 'styleConditions' , value ) || has ( 'defaultStyle' , value ) )
494+ ) {
492495 return this . handleDynamicStyle ( value ) ;
493496 }
494497 if ( OBJ_OF_FUNCTIONS [ target ] ) {
@@ -604,7 +607,10 @@ export default class DashAgGrid extends Component {
604607 ! equals (
605608 { ...omit ( OMIT_PROP_RENDER , nextProps ) } ,
606609 { ...omit ( OMIT_PROP_RENDER , this . props ) }
607- )
610+ ) &&
611+ ( nextProps ?. dashRenderType !== 'internal' ||
612+ ! equals ( nextProps . rowData , this . props . rowData ) ||
613+ ! equals ( nextProps . selectedRows , this . props . selectedRows ) )
608614 ) {
609615 return true ;
610616 }
@@ -617,14 +623,16 @@ export default class DashAgGrid extends Component {
617623 return true ;
618624 }
619625 if ( gridApi && ! gridApi ?. isDestroyed ( ) ) {
620- if ( columnState ) {
621- if ( columnState !== this . props . columnState ) {
622- return true ;
626+ if ( nextProps ?. dashRenderType !== 'internal' ) {
627+ if ( columnState ) {
628+ if ( columnState !== this . props . columnState ) {
629+ return true ;
630+ }
623631 }
624- }
625- if ( filterModel ) {
626- if ( ! equals ( filterModel , gridApi . getFilterModel ( ) ) ) {
627- return true ;
632+ if ( filterModel ) {
633+ if ( ! equals ( filterModel , gridApi . getFilterModel ( ) ) ) {
634+ return true ;
635+ }
628636 }
629637 }
630638 if ( selectedRows ) {
@@ -1170,7 +1178,7 @@ export default class DashAgGrid extends Component {
11701178 cellRendererData : {
11711179 value,
11721180 colId : props . column . colId ,
1173- rowIndex : props . rowIndex ,
1181+ rowIndex : props . node . sourceRowIndex ,
11741182 rowId : props . node . id ,
11751183 timestamp : Date . now ( ) ,
11761184 } ,
@@ -1494,3 +1502,6 @@ DashAgGrid.propTypes = {parentState: PropTypes.any, ..._propTypes};
14941502
14951503export const propTypes = DashAgGrid . propTypes ;
14961504export const defaultProps = DashAgGrid . defaultProps ;
1505+
1506+ var dagfuncs = ( window . dash_ag_grid = window . dash_ag_grid || { } ) ;
1507+ dagfuncs . useGridFilter = useGridFilter ;
0 commit comments