Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Kongyik 28 posts 170 karma points
    Mar 23, 2015 @ 08:31
    Peter Kongyik
    0

    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

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 23, 2015 @ 09:33
    Sören Deger
    102

    Hi Peter,

    insert this in your angularJS view:

    <form name="myForm"
          ng-controller="myControlelrName"
          ng-show="loaded"
          val-form-manager> 

    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

  • Peter Kongyik 28 posts 170 karma points
    Mar 24, 2015 @ 02:45
    Peter Kongyik
    0

    Hi Sören! Perfect answser, works, many thanks! 

    Peter

Please Sign in or register to post replies

Write your reply to:

Draft