Skip to content

Commit 04e6e9a

Browse files
committed
remove redundant usages of updateWeekDaysButtons()
1 parent 3c0717b commit 04e6e9a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ export class AppointmentPopup {
192192

193193
const formData = this._createFormData(appointmentAdapter);
194194

195-
this.form.formData = formData;
196195
this.form.readOnly = this._isReadOnly(appointmentAdapter);
196+
this.form.formData = formData;
197197

198198
this.form.showMainGroup();
199199
}

packages/devextreme/js/__internal/scheduler/appointment_popup/m_recurrence_form.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class RecurrenceForm {
179179

180180
setReadOnly(value: boolean): void {
181181
this._readOnly = value;
182-
this.updateWeekDaysButtons();
182+
// this.updateWeekDaysButtons();
183183
}
184184

185185
createRecurrenceFormGroup(): GroupItem {
@@ -346,6 +346,7 @@ export class RecurrenceForm {
346346
this.weekDayItems.forEach((item) => {
347347
const buttonContainer = $('<div>').appendTo($container);
348348

349+
this._weekDayButtons[item.key]?.dispose();
349350
this._weekDayButtons[item.key] = this.scheduler.createComponent(buttonContainer, Button, {
350351
text: item.text,
351352
disabled: this._readOnly,
@@ -367,6 +368,7 @@ export class RecurrenceForm {
367368
this.recurrenceRule.byDay.push(item.key);
368369
}
369370

371+
// todo: update state only of the current button and remove this.updateWeekDaysButtons
370372
this.updateWeekDaysButtons();
371373
},
372374
});
@@ -603,6 +605,7 @@ export class RecurrenceForm {
603605
const dayOfMonthGroup = `${recurrencePatternGroupPath}.${EDITOR_NAMES.recurrenceDayOfMonthEditor}`;
604606
const dayOfYearGroup = `${recurrencePatternGroupPath}.${GROUP_NAMES.recurrenceDayOfYearGroup}`;
605607

608+
this.dxForm.beginUpdate();
606609
this.dxForm.itemOption(daysOfWeekGroup, 'visible', false);
607610
this.dxForm.itemOption(dayOfMonthGroup, 'visible', false);
608611
this.dxForm.itemOption(dayOfYearGroup, 'visible', false);
@@ -621,7 +624,7 @@ export class RecurrenceForm {
621624
break;
622625
}
623626

624-
this.updateWeekDaysButtons();
627+
this.dxForm.endUpdate();
625628
}
626629

627630
private updateWeekDaysButtons(): void {
@@ -630,7 +633,7 @@ export class RecurrenceForm {
630633

631634
button.option('stylingMode', isSelected ? 'contained' : 'outlined');
632635
button.option('type', isSelected ? 'default' : 'normal');
633-
button.option('disabled', this._readOnly);
636+
// button.option('disabled', this._readOnly);
634637
});
635638
}
636639
}

0 commit comments

Comments
 (0)