Copied to clipboard

Flag this post as spam?

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


  • Kristoffer L. Jakobsen 9 posts 89 karma points
    Aug 10, 2016 @ 06:49
    Kristoffer L. Jakobsen
    0

    Close dialogues...

    Hi,

    I have made a site, where I have extended the back-end. I use dialogs to collect some information from the user. But I do not think I open or close them right. Because when I have opened a dialog twice, the save function is called twice and so forth.

    Is there a special way to close dialogs or something I should do?

    Now i open by call open on dialogService and closes by call $scope.submit(data).

    I hope you can help!

  • Cimplex 113 posts 576 karma points
    Aug 10, 2016 @ 07:08
    Cimplex
    0

    Hi Kristoffer, I'm opening my dialogs with this code:

    dialogService.open({
        template: '/app_plugins/....',
        show: true
    });
    

    And in each dialog i usually add a close button:

    $scope.close = function () {
        dialogService.closeAll();
    };
    

    // Herman

  • Kristoffer L. Jakobsen 9 posts 89 karma points
    Aug 10, 2016 @ 08:11
    Kristoffer L. Jakobsen
    0

    Hi Herman

    what to do in situation, where you do not have a close, but an automated save function. Should I call dialogService.closeAll() after $scope.submit()?

    //Kristoffer

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Aug 10, 2016 @ 07:44
    Dennis Aaen
    0

    Hi Kristoffer,

    You can also find the documentation on the dialogue service here.

    https://our.umbraco.org/apidocs/ui/#/api/umbraco.services.dialogService and here you all the documentation for Umbraco Backoffice UI

    https://our.umbraco.org/apidocs/ui/#/api

    Hope this helps,

    /Dennis

  • Cimplex 113 posts 576 karma points
    Aug 10, 2016 @ 08:22
    Cimplex
    0

    Hi Kristoffer,

    I usually never save any changes in my dialog controllers I just edit the main model and save the changes in the main controller and not the dialog controller. But a solution could be something like this in the dialog controller:

    $scope.saveChanges = function () {
        myResource.save($scope.model).then(function (response) {
            notificationsService.success("Success", "Settings saved");
    
            $scope.close();
        });
    };
    
    $scope.close = function () {
        dialogService.closeAll();
    };
    

    // Herman

Please Sign in or register to post replies

Write your reply to:

Draft