@@ -856,43 +856,36 @@ class GridView extends Component {
856856 * @param {Object } data.record
857857 */
858858 onStoreRecordChange ( { fields, record} ) {
859- let me = this ,
860- fieldNames = fields . map ( field => field . name ) ,
861- needsUpdate = false ,
862- rowIndex = me . store . indexOf ( record ) ,
863- { selectionModel, vdom } = me ,
864- cellId , cellNode , cellStyle , cellVdom , column , columnIndex ;
859+ let me = this ,
860+ fieldNames = fields . map ( field => field . name ) ,
861+ needsUpdate = false ,
862+ rowIndex = me . store . indexOf ( record ) ,
863+ { selectionModel} = me ,
864+ column , needsCellUpdate ;
865865
866866 if ( fieldNames . includes ( me . colspanField ) ) {
867867 me . vdom . cn [ rowIndex ] = me . createRow ( { record, rowIndex} ) ;
868868 me . update ( )
869869 } else {
870+ for ( column of me . parent . columns . items ) {
871+ if (
872+ column instanceof Neo . grid . column . Component &&
873+ Neo . typeOf ( column . component === 'Function' ) &&
874+ ! fieldNames . includes ( column . dataField )
875+ ) {
876+ needsCellUpdate = me . updateCellNode ( record , column . dataField ) ;
877+ needsUpdate = needsUpdate || needsCellUpdate
878+ }
879+ }
880+
870881 fields . forEach ( field => {
871882 if ( field . name === me . selectedRecordField ) {
872883 if ( selectionModel . ntype === 'selection-grid-rowmodel' ) {
873884 selectionModel [ field . value ? 'select' : 'deselect' ] ( me . getRowId ( record ) )
874885 }
875886 } else {
876- cellId = me . getCellId ( record , field . name ) ;
877- cellNode = VDomUtil . find ( vdom , cellId ) ;
878-
879- // The vdom might not exist yet => nothing to do in this case
880- if ( cellNode ?. vdom ) {
881- cellStyle = cellNode . vdom . style ;
882- column = me . getColumn ( field . name ) ;
883- columnIndex = cellNode . index ;
884- cellVdom = me . applyRendererOutput ( { cellId, column, columnIndex, record, rowIndex} ) ;
885- needsUpdate = true ;
886-
887- // The cell-positioning logic happens outside applyRendererOutput()
888- // We need to preserve these styles
889- Object . assign ( cellVdom . style , {
890- left : cellStyle . left ,
891- width : cellStyle . width
892- } ) ;
893-
894- cellNode . parentNode . cn [ columnIndex ] = cellVdom
895- }
887+ needsCellUpdate = me . updateCellNode ( record , field . name ) ;
888+ needsUpdate = needsUpdate || needsCellUpdate
896889 }
897890 } )
898891 }
@@ -949,6 +942,41 @@ class GridView extends Component {
949942 }
950943 }
951944
945+ /**
946+ * Update the cell vdom silently
947+ * @param {Record } record
948+ * @param {String } dataField
949+ * @returns {Boolean } true in case the view needs an update
950+ */
951+ updateCellNode ( record , dataField ) {
952+ let me = this ,
953+ cellId = me . getCellId ( record , dataField ) ,
954+ cellNode = VDomUtil . find ( me . vdom , cellId ) ,
955+ needsUpdate = false ,
956+ rowIndex = me . store . indexOf ( record ) ,
957+ cellStyle , cellVdom , column , columnIndex ;
958+
959+ // The vdom might not exist yet => nothing to do in this case
960+ if ( cellNode ?. vdom ) {
961+ cellStyle = cellNode . vdom . style ;
962+ column = me . getColumn ( dataField ) ;
963+ columnIndex = cellNode . index ;
964+ cellVdom = me . applyRendererOutput ( { cellId, column, columnIndex, record, rowIndex} ) ;
965+ needsUpdate = true ;
966+
967+ // The cell-positioning logic happens outside applyRendererOutput()
968+ // We need to preserve these styles
969+ Object . assign ( cellVdom . style , {
970+ left : cellStyle . left ,
971+ width : cellStyle . width
972+ } ) ;
973+
974+ cellNode . parentNode . cn [ columnIndex ] = cellVdom
975+ }
976+
977+ return needsUpdate
978+ }
979+
952980 /**
953981 *
954982 */
0 commit comments