Copied to clipboard

Flag this post as spam?

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


  • mmaty 117 posts 311 karma points
    Jul 08, 2015 @ 10:12
    mmaty
    0

    dialogService - submit button doesn't appear

    Hi all,

    I have a problem with a custom dialog puzzling me. I hope, somebody here can give me a hint. The dialog refuses to show the submit button and cancel link.

    I open the dialog with the following code as part of a grid editor:

    $scope.openSymbolDialog = function () {     
        dialogService.open( {
            template: "/app_plugins/ff-grideditors/ff-symbol-dialog.html",
            callback: function ( data ) {
                console.log("Im Callback: " + data);
            },
            dialogData: { size: $scope.control.value.size }
        } );
    }
    

    This code works well and opens the dialog. The dialog is as follows:

    <div ng-controller="ff-SymbolDialog-controller">
        <form name="ffSymbolDialogForm" id="ffSymbolDialogForm" ng-submit="submit(dialogData)">
    
            <div class="umb-panel">
                <div class="umb-panel-body no-header umb-scrollable with-footer">
                    <div class="umb-pane">
                        <h4>Symbol</h4>
                        <umb-control-group label="Größe">
                            <select ng-model="dialogData.size" ng-options="sz for sz in sizes">
                        </umb-control-group>
                    </div>
                </div>
                <div class="umb-panel-footer">
                    <div class="btn-toolbar umb-btn-toolbar ">
                        <a class="btn btn-link" ng-click="close()">
                            <localize key="cancel" />
                        </a>
                        <button type="submit" class="btn btn-primary">
                            <localize key="buttons_save">Save</localize>
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>  
    

    The implementation follows the sample found here. The according controller is very simple:

    angular.module( "umbraco" ).controller( "ff-SymbolDialog-controller", function ( $scope ) {
            $scope.sizes = ["small", "medium", "big"];
            console.log("Im ff-SymbolDialog-controller: " + $scope.dialogData.size);
    });
    

    The part starting with <div class="umb-panel-footer"> doesn't appear in the DOM of the page. I made sure that the cache is not used, so everything is loaded from the server (Http 200).

    It seems as if AngularJs removes this part of the DOM, but I have no glue about, why.

    Any hint would be very much appreciated.

    Mirko

  • mmaty 117 posts 311 karma points
    Jul 08, 2015 @ 11:32
    mmaty
    0

    I found the error. The closing tag of the select was missing. Just for the records the code of the dialog as it works now:

    <div ng-controller="ff-SymbolDialog-controller">
        <div class="umb-panel">
            <div class="umb-panel-body no-header umb-scrollable with-footer">
                <div class="umb-pane">
                    <h4>Symbol</h4>
                    <umb-control-group label="Größe">
                        <select ng-model="dialogData.size" ng-options="sz for sz in sizes"></select>
                    </umb-control-group>
                </div>              
            </div>
            <div class="umb-panel-footer">
                <div class="btn-toolbar umb-btn-toolbar">
                    <a class="btn btn-link" ng-click="close()">
                        <localize key="cancel" />
                    </a>
                    <a href ng-click="submit(dialogData)" class="btn btn-primary">
                        <localize key="buttons_save">Save</localize>
                    </a>
                </div>
            </div>
        </div>
    </div>      
    

    Mirko

  • 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