groupoffice icon indicating copy to clipboard operation
groupoffice copied to clipboard

Confirm close window with changes

Open ijuliusz opened this issue 10 months ago • 2 comments

Hi :)

The default notification for closing a dialog window before saving appears even when changes have not been made. This happens in a dialog window where data is automatically populated immediately after its opening.

There are situations in the modules I've created where data isn't fetched 'live' upon opening, and in those cases, such a window can be closed without notification.

Is it possible to disable this for a specific dialog window?

Juliusz

ijuliusz avatar Apr 18 '24 12:04 ijuliusz

You can do two things:

  1. set closeWithModification = true on the window
  2. call yourwin.formPanel.form.trackReset(); after populating so it will behave as it should.

Good luck!

mschering avatar Apr 18 '24 12:04 mschering

I applied solution number 2. I used it in either onReady: or this.on('ready', function(){...}) just before the last closing curly brace.

It works Thank you.

ijuliusz avatar Apr 19 '24 09:04 ijuliusz