@@ -66,6 +66,12 @@ export class MatrixDropdownCell {
6666 this . questionValue = this . createQuestion ( column , row , data ) ;
6767 this . questionValue . updateCustomWidget ( ) ;
6868 this . updateCellQuestionTitleDueToAccessebility ( row ) ;
69+ this . questionValue . registerPropertyChangedHandlers (
70+ [ "isVisible" ] , ( ) => {
71+ this . onQuestionVisibilityChanged ( ) ;
72+ } ,
73+ "cell"
74+ ) ;
6975 }
7076 private updateCellQuestionTitleDueToAccessebility ( row : MatrixDropdownRowModelBase ) : void {
7177 this . questionValue . locTitle . onGetTextCallback = ( str : string ) : string => {
@@ -115,6 +121,13 @@ export class MatrixDropdownCell {
115121 public runCondition ( properties : HashTable < any > ) : void {
116122 this . question . runCondition ( properties ) ;
117123 }
124+ private onQuestionVisibilityChanged ( ) : void {
125+ this . column . onCellVisibilityChanged ( this . question . isVisible ) ;
126+ }
127+ public dispose ( ) : void {
128+ this . questionValue . unregisterPropertyChangedHandlers ( [ "isVisible" ] , "cell" ) ;
129+ this . questionValue . dispose ( ) ;
130+ }
118131}
119132
120133export class MatrixDropdownTotalCell extends MatrixDropdownCell {
@@ -827,6 +840,9 @@ export class MatrixDropdownRowModelBase extends DynamicItemModelBase implements
827840 private onEditingObjPropertyChanged : ( sender : Base , options : any ) => void ;
828841 private editingObjValue : Base ;
829842 public dispose ( ) : void {
843+ for ( let i = 0 ; i < this . cells . length ; i ++ ) {
844+ this . cells [ i ] . dispose ( ) ;
845+ }
830846 if ( ! ! this . editingObj ) {
831847 this . editingObj . onPropertyChanged . remove (
832848 this . onEditingObjPropertyChanged
@@ -1399,6 +1415,12 @@ export class QuestionMatrixDropdownModelBase extends QuestionMatrixBaseModel<Mat
13991415 onColumnVisibilityChanged ( column : MatrixDropdownColumn ) : void {
14001416 this . resetTableAndRows ( ) ;
14011417 }
1418+ onColumnCellVisibilityChanged ( column : MatrixDropdownColumn ) : void {
1419+ if ( this . isDesignMode || this . isRunningCellsCondition ) return ;
1420+ if ( this . isColumnVisibilityChanged ( column , true ) ) {
1421+ this . resetRenderedTable ( true ) ;
1422+ }
1423+ }
14021424 onColumnCellTypeChanged ( column : MatrixDropdownColumn ) : void {
14031425 this . updateDefaultRowValue ( column ) ;
14041426 this . resetTableAndRows ( ) ;
@@ -1547,9 +1569,11 @@ export class QuestionMatrixDropdownModelBase extends QuestionMatrixBaseModel<Mat
15471569 protected shouldRunColumnExpression ( ) : boolean {
15481570 return false ;
15491571 }
1572+ private isRunningCellsCondition : boolean ;
15501573 protected runCellsCondition ( properties : HashTable < any > ) : boolean {
15511574 if ( this . isDesignMode ) return false ;
15521575 let isRowVisiblilityChanged = false ;
1576+ this . isRunningCellsCondition = true ;
15531577 const isAlwaysVisible = this . areInvisibleElementsShowing ;
15541578 const rowsVisibleIf = this . getExpressionFromSurvey ( "rowsVisibleIf" ) ;
15551579 const rows = this . generatedVisibleRows ;
@@ -1564,6 +1588,7 @@ export class QuestionMatrixDropdownModelBase extends QuestionMatrixBaseModel<Mat
15641588 }
15651589 this . checkColumnsVisibility ( ) ;
15661590 this . checkColumnsRenderedRequired ( ) ;
1591+ this . isRunningCellsCondition = false ;
15671592 return isRowVisiblilityChanged ;
15681593 }
15691594 protected runConditionsForColumns ( properties : HashTable < any > ) : boolean {
0 commit comments