Copied to clipboard

Flag this post as spam?

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


  • Stefan Kip 1614 posts 4131 karma points c-trib
    Feb 10, 2021 @ 11:25
    Stefan Kip
    0

    Documentation/instructions on how to use the umbEditorHeader directive's menu property

    Hi,

    I'm looking for documentation or instructions on how to use the umbEditorHeader directive's menu property.
    I have this for now:

    {
        metaData: {
            dialogTitle: "Print",
            actionView: "/app_plugins/Vendr.PrintOrder/views/print.html"
        },
        name: "Print",
        alias: "print",
        separator: true,
        cssclass: "printer-alt",
        opensDialog: true,
        condition: function (ctx) {
            return ctx.nodeType === "Order";
        },
        sortOrder: 110
    }
    

    The issue is; this opens the view in a panel. I'd like to open a URL in a new tab/window so I can call the print dialog and close the tab/window again.
    Any help will be much appreciated!

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Feb 12, 2021 @ 10:44
    Søren Kottal
    0

    I don't think you can, but maybe you can put your window/tab-opening code in the dialog that opens, and programmatically close the dialog, when the window/tab has opened.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Feb 12, 2021 @ 10:46
    Stefan Kip
    0

    The issue is pop-up blockers. You have to be inside an action handler to be able to open a new window :-(

    https://stackoverflow.com/a/2587692/510149

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Feb 12, 2021 @ 10:50
    Søren Kottal
    0

    Do you have to have it in a window? Couldn't it be an iframe instead?

    Anyways - Kevin Jump just posted this blog article that might help you (haven't read it through though, but sounds pretty much like your problem)

    https://blog.jumoo.co.uk/2021/opening-infinite-actions/

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Feb 12, 2021 @ 10:54
    Stefan Kip
    0

    Not really unfortunately, I'm talking about the menu actions in the umbEditorHeader, which is this one:

    enter image description here

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Feb 12, 2021 @ 11:57
    Søren Kottal
    0

    Pretty sure it's the same. On a content node you can open the action menu either in the header, or by right clicking the tree.

  • Stefan Kip 1614 posts 4131 karma points c-trib
    Feb 12, 2021 @ 12:33
    Stefan Kip
    0

    I guess you're right. Unfortunately, the jsAction solution doesn't work, because an error is triggered: The source object does not contain the property icon
    I found the source of this error here: https://github.com/umbraco/Umbraco-CMS/blob/34e80d86e8c0b754f6b7a02e307f53cb32806bbe/src/Umbraco.Web.UI.Client/src/common/services/util.service.js#L178
    So I guess it's trying to pass the current item (in this case a Vendr order) to the handler, but it doesn't have an icon property.
    No clue how I could work around this tbh.

Please Sign in or register to post replies

Write your reply to:

Draft