@@ -280,6 +280,13 @@ export class AppointmentForm {
280280 this . updateDateEditorsValues ( ) ;
281281 }
282282
283+ if ( isRecurrenceRuleChanged || startDateExpr === dataField ) {
284+ this . _recurrenceForm . updateRecurrenceFormValues (
285+ this . recurrenceRuleRaw ,
286+ this . startDate ,
287+ ) ;
288+ }
289+
283290 if ( isRecurrenceRuleChanged ) {
284291 this . updateRepeatEditorValue ( ) ;
285292 }
@@ -663,8 +670,14 @@ export class AppointmentForm {
663670 onValueChanged : ( e ) : void => {
664671 if ( e . value === repeatNeverValue ) {
665672 this . dxForm . updateData ( recurrenceRuleExpr , '' ) ;
666- this . _recurrenceForm . recurrenceRule = new RecurrenceRule ( '' , this . startDate ) ;
667- } else if ( e . event ) {
673+ } else {
674+ const currentRecurrenceRule = this . _recurrenceForm . recurrenceRule . toString ( ) ?? '' ;
675+ const recurrenceRule = new RecurrenceRule ( currentRecurrenceRule , this . startDate ) ;
676+ recurrenceRule . frequency = e . value ;
677+ this . dxForm . updateData ( recurrenceRuleExpr , recurrenceRule . toString ( ) ) ;
678+ }
679+
680+ if ( e . value !== repeatNeverValue && e . event ) {
668681 this . showRecurrenceGroup ( ) ;
669682 }
670683
@@ -847,14 +860,6 @@ export class AppointmentForm {
847860 this . _$recurrenceGroup ?. removeClass ( CLASSES . recurrenceHidden ) ;
848861 this . _$recurrenceGroup ?. removeAttr ( 'tabindex' ) ;
849862
850- const repeatEditorValue = this . dxForm . getEditor ( REPEAT_EDITOR_NAME ) ?. option ( 'value' ) ;
851-
852- this . _recurrenceForm . updateRecurrenceFormValues (
853- repeatEditorValue ,
854- this . recurrenceRuleRaw ,
855- this . startDate ,
856- ) ;
857-
858863 this . _popup . updateToolbarForRecurrenceGroup ( ) ;
859864 }
860865
@@ -873,7 +878,6 @@ export class AppointmentForm {
873878 this . _$recurrenceGroup ?. attr ( 'tabindex' , '-1' ) ;
874879
875880 this . _popup . updateToolbarForMainGroup ( ) ;
876- this . updateRepeatEditorValue ( ) ;
877881 }
878882
879883 saveRecurrenceValue ( ) : void {
@@ -932,18 +936,12 @@ export class AppointmentForm {
932936
933937 if ( this . recurrenceRuleRaw === null ) {
934938 repeatEditor . option ( 'value' , repeatNeverValue ) ;
935- this . _recurrenceForm . recurrenceRule = new RecurrenceRule ( '' , this . startDate ) ;
936939 } else {
937940 const recurrenceRule = new RecurrenceRule ( this . recurrenceRuleRaw , this . startDate ) ;
938941 const { frequency } = recurrenceRule ;
939942 const value = frequency ?? repeatNeverValue ;
940943
941944 repeatEditor . option ( 'value' , value ) ;
942- this . _recurrenceForm . updateRecurrenceFormValues (
943- value === repeatNeverValue ? '' : value ,
944- this . recurrenceRuleRaw ,
945- this . startDate ,
946- ) ;
947945 }
948946 }
949947
0 commit comments