Copied to clipboard

Flag this post as spam?

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


  • Tom 119 posts 447 karma points
    Jun 16, 2014 @ 10:56
    Tom
    0

    dialogService.propertyDialog

    Hi

    Has anyone on here tried using dialogService.propertyDialog? http://umbraco.github.io/Belle/#/api/umbraco.services.dialogService

    I want to open a dialog with either a custom propery editor or one of the build-in ones, fx. Umbraco.Integer?

    Some ideas how to?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jun 19, 2014 @ 19:37
    Matt Brailsford
    0

    Hey Tom,

    Haven't used it myself but the docs seem pretty comprehensive. What exactly are you having problems with? Do you have any code already we could take a look at?

    Many thanks

    Matt

  • Tom 119 posts 447 karma points
    Jun 19, 2014 @ 20:13
    Tom
    0

    Hi Matt,

    This is all the documentation available, so I'm not sure about comprehensive. Also it seem to be copy+paste from dialogservice.mediapicker.

    propertyDialog(options, editor, value)
    
    Opens a dialog with a chosen property editor in, a value can be passed to the modal, and this value is returned in the callback
    
    Parameters
    
    options – {Object} – mediapicker dialog options object
    options.callback – {Function} – callback function
    editor – {String} – editor to use to edit a given value and return on callback
    value – {Object} – value sent to the property editor
    Returns
    
    {Object} – modal object
    

    All in all I'm not sure what the method does, and I'm not sure how to pass a certain property editor to the method.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jun 20, 2014 @ 10:03
    Matt Brailsford
    0

    Hi Tom,

    Ok, lets see if an example will help.

    angular.module("umbraco").controller("myController",
        [
            "$scope",
            "dialogService",=
    
            function ($scope, dialogService) {
    
                dialogService.propertyDialog({
                    editor: "", // I believe this is the DTDID of the editor to render
                    value: "", // This is the stored value of the editor
                    callback: function(value){
                        // Do something with the value
                    }
                });
    
            }
    
        ]);
    

    I believe the above should work. Basically calling the propertyDialog with an editor ID and a value for that editor (ie, the last stored value) it'll launch a dialog with that specific editor control. The user will interact with it and on clicking save, your callback method will be called passed down the updated value for you to do whatever you want with it (store it, then pass it into the dialog service again when they want to edit the value).

    Is that any clearer?

    Many thanks

    Matt

  • Tom 119 posts 447 karma points
    Aug 15, 2014 @ 10:06
    Tom
    0

    bringing up this old thread again...

    when I look in umbraco.services.js this is what is being executed:

    propertyDialog: function (options) {
                options.template = 'views/common/dialogs/property.html';
                options.show = true;
                return openDialog(options);
            }
    

    When looking at the template 'views/common/dialogs/property.html' only thing in there is:

    {{propertyTypeToRender}}
    

    Maybe its just me - but that doesn't seem to do anything...?

  • Jamie Pollock 174 posts 853 karma points c-trib
    Oct 07, 2014 @ 18:07
    Jamie Pollock
    0

    Hey folks,
    Sorry to necro the thread. I'm using v7.1.7 and am also curious to what the below bit of code does.

    {{propertyTypeToRender}}
    

    I can't find any directive in reference to it. The documentation is fairly clear but this doesn't really render anything.

    Thanks,
    Jamie

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Oct 08, 2014 @ 13:54
    Warren Buckley
    0

    Hello Guys,
    I have flagged this as a bug. As to me there is no controller or anyway for the view to know about the item propertyTypeToRender. I would say this was started and not used in the main core product of Umbraco and thus has got forgotten about & never finished.

    The view is mainly empty:
    https://github.com/umbraco/Umbraco-CMS/blob/eae00873073f20c60e355ec6e95ff6259ad2652b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/property.html

    The propertyDialog requires us to pass more data in, such as the editor to use and the existing value if set already along with some other options:
    https://github.com/umbraco/Umbraco-CMS/blob/eae00873073f20c60e355ec6e95ff6259ad2652b/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js#L487

    But looking at the main function in the dialogService of openDialog it does nothing with these values currently.

    I have raised an issue on the bug tracker to be voted up.
    http://issues.umbraco.org/issue/U4-5610

    Cheers,
    Warren

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Oct 11, 2014 @ 14:41
    Dan Diplo
    0

    Not sure if this is of use, but you can pass data into the dialogService through the (undocumented) dialogData property. I use this in my Trace Log Viewer to pass in a logItem object to the service:

    var dialog = dialogService.open({
        template: '/App_Plugins/DiploTraceLogViewer/backoffice/diplotracelog/detail.html',
        dialogData: logItem, show: true, width: 800
    });

    It is then "magically" injected into the detail.html view.

     

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Oct 13, 2014 @ 10:22
    Warren Buckley
    0

    Yep good point Dan.
    Passing dialogData into your modal back and forth is insanely useful and Jamie could write his own HTML modal view and use the Open method on the dialogService if needed to.

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Oct 13, 2014 @ 10:23
    Warren Buckley
    0

    Also don't forget to vote that bug/issue up so it does get seen by someone at the Umbraco HQ for a response.

    http://issues.umbraco.org/issue/U4-5610

  • Jamie Pollock 174 posts 853 karma points c-trib
    Oct 13, 2014 @ 11:02
    Jamie Pollock
    0

    Hi gents,
    Just wanted to say, I did use the open function with dialogData when resolving this issue.

    I should probably mark this as closed. Sorry I wasn't a bit more clear in my responses last week. I found a solution which involved me writing my own dialog.

    Thanks,
    Jamie

    EDIT: oops, sorry Monday morning only half reading my emails. This was totally the wrong post I responded to! Leaving this post here for transparency. :P

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 05, 2015 @ 09:40
    Sören Deger
    0

    Hi Dan,

    the width is applied correctly in your dialog to 800? I have tested this now, but the width is always set to the default value.

     

    Best,

    Sören

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 05, 2015 @ 09:50
    Sören Deger
    0

    Hi Dan, 

    I have found it. The width option doesn't work for me. But I have used the modalClass option and add a own css class. This works for me.

     

    Best,

    Sören

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Mar 05, 2015 @ 15:11
    Dan Diplo
    0

    Yeah, it doesn't work for me, either, Soren. It looks like it hasn't been implemented, even though it appears you can use it.

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 05, 2015 @ 15:29
    Sören Deger
    0

    I have created an issue report:

    http://issues.umbraco.org/issue/U4-6367

    Please vote for it.

     

    Cheers,

    Sören

Please Sign in or register to post replies

Write your reply to:

Draft