Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 23, 2019 @ 09:26
    Ismail Mayat
    0

    how to stop you have unsaved changes message

    I am building a dashboard control in v8 i have it working fine. i have saved button that saves some data via keyvalue service.

    The dashboard is in settings section. after edits and no save navigating away to content gives you have unsaved changes message which is fine. However after save when i move i still see this message, do i need to update something like isDirty flag (not sure what this is in reality but making a guess) to stop this message appearing after a save?

    Regards

    Ismail

  • Kevin Jump 2348 posts 14896 karma points MVP 8x c-trib
    Jul 23, 2019 @ 09:38
    Kevin Jump
    0

    Hi,

    I think you need to set no-dirty-check on the input fields.

    https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.directives.directive:noDirtyCheck

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 23, 2019 @ 16:17
    Ismail Mayat
    100

    Ok so using post https://our.umbraco.com/forum/umbraco-7/developing-umbraco-7-packages/60404-Check-if-item-is-dirty-in-property-editor#comment-211173 I now have:

    var currForm = angularHelper.getCurrentForm($scope);
    currForm.$setPristine();
    notificationsService.success("Save", "Settings saved");
    

    which works nicely.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies