@@ -34,7 +34,7 @@ export class GanttDialog {
3434 return ;
3535 }
3636 const isRefresh = this . _popupInstance . _isVisible ( ) && this . _dialogInfo && this . _dialogInfo instanceof this . infoMap [ name ] ;
37- this . _dialogInfo = new this . infoMap [ name ] ( parameters , this . _apply . bind ( this ) , this . hide . bind ( this ) , editingOptions ) ;
37+ this . _dialogInfo = new this . infoMap [ name ] ( parameters , this . _apply . bind ( this ) , this . hide . bind ( this ) , editingOptions , this ) ;
3838 this . _popupInstance . option ( {
3939 showTitle : ! ! this . _dialogInfo . getTitle ( ) ,
4040 title : this . _dialogInfo . getTitle ( ) ,
@@ -51,19 +51,23 @@ export class GanttDialog {
5151 }
5252 }
5353 hide ( ) {
54- this . _popupInstance . hide ( ) ;
54+ if ( this . _dialogInfo . shouldHidePopup ( ) ) {
55+ this . _popupInstance . hide ( ) ;
56+ }
57+
5558 if ( this . _afterClosing ) {
5659 this . _afterClosing ( ) ;
5760 }
5861 }
5962}
6063
6164class DialogInfoBase {
62- constructor ( parameters , applyAction , hideAction , editingOptions ) {
65+ constructor ( parameters , applyAction , hideAction , editingOptions , owner ) {
6366 this . _parameters = parameters ;
6467 this . _applyAction = applyAction ;
6568 this . _hideAction = hideAction ;
6669 this . _editingOptions = editingOptions ;
70+ this . _owner = owner ;
6771 }
6872
6973 _getFormItems ( ) { return { } ; }
@@ -124,6 +128,9 @@ class DialogInfoBase {
124128 isValidated ( ) {
125129 return true ;
126130 }
131+ shouldHidePopup ( ) {
132+ return true ;
133+ }
127134}
128135
129136class TaskEditDialogInfo extends DialogInfoBase {
@@ -221,14 +228,36 @@ class TaskEditDialogInfo extends DialogInfoBase {
221228 text : '...' ,
222229 hint : messageLocalization . format ( 'dxGantt-dialogEditResourceListHint' ) ,
223230 onClick : ( ) => {
224- const showTaskEditDialogCallback = ( ) => { this . _parameters . showTaskEditDialogCommand . execute ( ) ; } ;
231+ const formData = this . getFormData ( ) ;
232+
233+ const showTaskEditDialogCallback = ( ) => {
234+ this . _parameters . showTaskEditDialogCommand . execute ( ) ;
235+
236+ this . _restoreFormData ( formData ) ;
237+ } ;
238+
225239 this . _parameters . showResourcesDialogCommand . execute ( showTaskEditDialogCallback ) ;
226240 }
227241 }
228242 } ]
229243 }
230244 } ] ;
231245 }
246+ _restoreFormData ( formData ) {
247+ const newForm = this . _owner . _dialogInfo . _form ;
248+
249+ const titleEdit = newForm . getEditor ( 'title' ) ;
250+ const assignedEdit = newForm . getEditor ( 'assigned.items' ) ;
251+ const startEdit = newForm . getEditor ( 'start' ) ;
252+ const endEdit = newForm . getEditor ( 'end' ) ;
253+ const progressEdit = newForm . getEditor ( 'progress' ) ;
254+
255+ titleEdit . option ( 'value' , formData . title ) ;
256+ assignedEdit . option ( 'value' , formData . assigned . items ) ;
257+ startEdit . option ( 'value' , formData . start ) ;
258+ endEdit . option ( 'value' , formData . end ) ;
259+ progressEdit . option ( 'value' , formData . progress ) ;
260+ }
232261 _getValidationMessage ( isStartDependencies , correctDate ) {
233262 if ( isStartDependencies ) {
234263 return messageLocalization . format ( 'dxGantt-dialogStartDateValidation' , this . _getFormattedDateText ( correctDate ) ) ;
@@ -313,6 +342,9 @@ class ResourcesEditDialogInfo extends DialogInfoBase {
313342 }
314343 } ] ;
315344 }
345+ shouldHidePopup ( ) {
346+ return false ;
347+ }
316348}
317349
318350class ConfirmDialogInfo extends DialogInfoBase {
0 commit comments