This repository was archived by the owner on Jun 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
packages/aurelia-slickgrid/src/extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,11 +137,14 @@ export class SlickRowDetailView extends UniversalSlickRowDetailView {
137137 this . _preloadController ?. dispose ( ) ;
138138
139139 // triggers after backend called "onAsyncResponse.notify()"
140- await this . renderViewModel ( args ?. item ) ;
141-
142- if ( typeof this . rowDetailViewOptions ?. onAsyncEndUpdate === 'function' ) {
143- this . rowDetailViewOptions . onAsyncEndUpdate ( event , args ) ;
144- }
140+ // because of the preload destroy above, we need a small delay to make sure the DOM element is ready to render the Row Detail
141+ queueMicrotask ( async ( ) => {
142+ await this . renderViewModel ( args ?. item ) ;
143+
144+ if ( typeof this . rowDetailViewOptions ?. onAsyncEndUpdate === 'function' ) {
145+ this . rowDetailViewOptions . onAsyncEndUpdate ( event , args ) ;
146+ }
147+ } ) ;
145148 } ) ;
146149
147150 this . _eventHandler . subscribe ( this . onAfterRowDetailToggle , async ( event , args ) => {
Original file line number Diff line number Diff line change @@ -346,4 +346,21 @@ describe('Example 19 - Row Detail View', () => {
346346 . find ( '.slick-cell + .dynamic-cell-detail .innerDetailView_101' )
347347 . should ( 'not.exist' ) ;
348348 } ) ;
349+
350+ it ( 'should expect the Row Detail to be re-rendered after expanding/collapsing multiple times' , ( ) => {
351+ cy . get ( '#grid19' ) . find ( '.slick-row:nth(1) .slick-cell:nth(0)' ) . as ( 'toggle1' ) ;
352+ cy . get ( '@toggle1' ) . click ( ) ;
353+ cy . get ( '@toggle1' ) . click ( ) ;
354+ cy . get ( '@toggle1' ) . click ( ) ;
355+
356+ cy . get ( '#grid19' ) . find ( '.slick-cell + .dynamic-cell-detail .innerDetailView_1' ) . as ( 'detailContainer' ) ;
357+ cy . get ( '@detailContainer' ) . find ( 'h3' ) . contains ( 'Task 1' ) ;
358+
359+ cy . get ( '@toggle1' ) . click ( ) ;
360+ cy . get ( '@detailContainer' ) . should ( 'not.exist' ) ;
361+
362+ cy . get ( '@toggle1' ) . click ( ) ;
363+ cy . get ( '#grid19' ) . find ( '.slick-cell + .dynamic-cell-detail .innerDetailView_1' ) . as ( 'detailContainer' ) ;
364+ cy . get ( '@detailContainer' ) . find ( 'h3' ) . contains ( 'Task 1' ) ;
365+ } ) ;
349366} ) ;
You can’t perform that action at this time.
0 commit comments