Skip to content

Commit

Permalink
Panel dynamic: creates panels based on template on demand fix #7662 (#…
Browse files Browse the repository at this point in the history
…7663)

* Panel dynamic: creates panels based on template on demand fix #7662

* Change visiblePanelCount getter #7662
  • Loading branch information
andrewtelnov authored Jan 15, 2024
1 parent d4b3703 commit c56382d
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 107 deletions.
9 changes: 6 additions & 3 deletions src/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1015,20 +1015,20 @@ export class PanelModelBase extends SurveyElement<Question>
public createRow(): QuestionRowModel {
return new QuestionRowModel(this);
}
public onSurveyLoad() {
public onSurveyLoad(): void {
for (var i = 0; i < this.elements.length; i++) {
this.elements[i].onSurveyLoad();
}
this.onElementVisibilityChanged(this);
}
public onFirstRendering() {
public onFirstRendering(): void {
super.onFirstRendering();
for (var i = 0; i < this.elements.length; i++) {
this.elements[i].onFirstRendering();
}
this.onRowsChanged();
}
public updateRows() {
public updateRows(): void {
if (this.isLoadingFromJson) return;
for (var i = 0; i < this.elements.length; i++) {
if (this.elements[i].isPanel) {
Expand Down Expand Up @@ -1359,6 +1359,9 @@ export class PanelModelBase extends SurveyElement<Question>
} else {
this.elements.splice(index, 0, element);
}
if(this.wasRendered) {
element.onFirstRendering();
}
return true;
}

Expand Down
Loading

0 comments on commit c56382d

Please sign in to comment.