I'm building my custom section for the backoffice and I noticed that there is a confirming popup whenver I edit something in the built in sections (let's say a document type) and if there is any dirty data a popup is shown which prevents losing my changes when I want to navigate away.
My question is that is there a built-in serrvice for this which I can leverage in my custom section? To show the nice "discard changes or stay here" popup. Or is it supposed to be impletemented uniquily for each section?
Custom section: change detection
Hi guys!
I'm building my custom section for the backoffice and I noticed that there is a confirming popup whenver I edit something in the built in sections (let's say a document type) and if there is any dirty data a popup is shown which prevents losing my changes when I want to navigate away.
My question is that is there a built-in serrvice for this which I can leverage in my custom section? To show the nice "discard changes or stay here" popup. Or is it supposed to be impletemented uniquily for each section?
thank in advance,
Peter
Hi Peter,
insert this in your angularJS view:
Now, if you add the required attribute to an input field the popup is shown which prevents losing you changes.
You can also manipulate this with $setDirty(). More informations you can find in this topic:
https://our.umbraco.org/forum/umbraco-7/developing-umbraco-7-packages/60404-Check-if-item-is-dirty-in-property-editor
Hope this helps?
Best,
Sören
Hi Sören! Perfect answser, works, many thanks!
Peter
is working on a reply...