Copied to clipboard

Flag this post as spam?

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


  • Bilal Haidar 144 posts 410 karma points
    Dec 27, 2016 @ 11:31
    Bilal Haidar
    0

    Dialog Window inside umbOverlay

    Hi,

    I am working on a custom grid property editor. When the editor clicks on the property inside the grid layout, the umbOverlay view opens.

    In the umbOverlay, the editor needs to select a value, by click on a button, opening a "new umbOverlay" or "new Dialog"?!?!?!, the editor can search for images (communicating with a REST API), select the image and then go back to original umbOverlay.

    Is this doable in Umbraco?

    1. Using another overlay or dialog inside an umbOverlay
    2. Having a controller for the umbOverlay view so that I could communicate with external APIs.

    Thanks, Bilal

  • Rune Hem Strand 147 posts 911 karma points hq c-trib
    Dec 27, 2016 @ 11:50
    Rune Hem Strand
    101

    Yup, it is possible!

    Add another overlay in the overlay view and they will nest nicely. You can see it when configuring data types in the document type editor: enter image description here

    Don't know if you've seen it but there is docs on backoffice directives that might be useful.

    /Rune

  • Bilal Haidar 144 posts 410 karma points
    Dec 27, 2016 @ 11:57
    Bilal Haidar
    0

    Thanks again Rune. I am thinking of it more now that I could have a controller specific for the original umbOverlay, there, I can open a new umbOverlay and connect to REST APIs using angular, correct?

    Thanks Bilal

  • Rune Hem Strand 147 posts 911 karma points hq c-trib
    Dec 27, 2016 @ 12:18
    Rune Hem Strand
    2

    Yup, that is possible, assume you're talking about this overlay :) You can either extend that or create a new nested overlay with it's own controller. Once in the controller is hooked up you can do any JS/Angular magic you want.

    Adding a controller to the overlay in the above example is a matter of:

    1. Creating a js file, GridCtaButtonOverlay.controller.js, and adding it to the umbraco module:

      (function () {
         "use strict";
      
      
         function Controller($scope) {
            //Add magic
         }
      
      
         angular.module("umbraco").controller("rhs.gridctabuttonoverlaycontroller", Controller);
      })();
      
    2. Hook it up in the view GridCtaButtonOverlay.html:

       <div ng-controller="rhs.gridctabuttonoverlaycontroller">
           <!-- Overlay html -->
       </div>
      
    3. Load controller in package.manifest:

      "javascript": [
         "~/App_Plugins/GridCtaButton/GridCtaButton.controller.js",
         "~/App_Plugins/GridCtaButton/GridCtaButtonOverlay.controller.js"
      ]
      

    That should do the trick :)

Please Sign in or register to post replies

Write your reply to:

Draft