Copied to clipboard

Flag this post as spam?

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


  • Yasharth Tahiliani 8 posts 78 karma points
    Jun 14, 2021 @ 15:48
    Yasharth Tahiliani
    0

    Custom Infinite Editor using Editor Service not displaying Submit and Close buttons

    Hi, I am migrating over a Property Editor from Umbraco 7 onto Umbraco 8. The custom property editor uses an Overlay to display an item selector, but since overlays do not work in Umbraco 8, I am using the editorService.open() method instead. The list is displaying fine in an infinite editor, but it is not showing any Submit or Close buttons, and neither the Title and Pagination for the list like it does in the Umbraco 7 application.

    I am using the following code:

            editorService.open({
                title: "Available videos",
                subtitle: "Select video(s) in the list",
                view: "/App_Plugins/Newsroom.VideoFormatEditor/dialog/videopicker.html",
                size: "small",
                submit: function (value) {
                    // Custom code for the list
                };
                 close: function () {
                    editorService.close();
                }
    

    and here is what is being displayed

    enter image description here

    Can someone please help?

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Jun 14, 2021 @ 16:30
    Dan Diplo
    2

    You need to have the buttons on the view that is being opened. So in your case your videopicker.html would need to have those buttons. Typically you'd use an umb-editor-footer directive to show this.

    Here's an example from something I wrote:

        <umb-editor-footer ng-if="model.infiniteMode">
    
            <umb-editor-footer-content-right>
                <umb-button type="button"
                            button-style="link"
                            label-key="general_close"
                            shortcut="esc"
                            action="model.close()">
                </umb-button>
            </umb-editor-footer-content-right>
    
        </umb-editor-footer>
    

    The close button is only shown when the view is opened within an infinite editor. Hope that helps.

  • Yasharth Tahiliani 8 posts 78 karma points
    Jun 15, 2021 @ 08:23
    Yasharth Tahiliani
    0

    Hi Dan,

    Thanks a lot! I managed to get the Close and Submit buttons in place.

    I however am having issues passing on the model when submitting. The following is the submit function, which receives no data on submitting.

            editorService.open({
                title: "Available videos",
                multiPicker: true,
                subtitle: "Select video(s) in the list",
                view: "/App_Plugins/Newsroom.VideoFormatEditor/dialog/videopicker.html",
                size: "small",
                submit: function (model) {
                    if (angular.isArray(model.selection)) {
                        $scope.videoInfoLoaded = false;
                        var count = model.selection.length;
                        var nbVideoLoaded = 0;
    

    I have essentially copied over this code from the Umbraco 7 application where it works absolutely fine, so it seems that a lot has changed in terms of the Custom Property Editors. Do you know of any examples that I can follow to migrate over the Custom Property editors onto the new Umbraco 8 application?

    Thanks!

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Jun 15, 2021 @ 09:54
    Dan Diplo
    0

    Glad it worked!

    There's an example of creating a custom property editor in the docs at:

    https://our.umbraco.com/Documentation/Tutorials/Creating-a-Property-Editor/

    Another good place to look for examples is in the Umbraco 8 source code:

    https://github.com/umbraco/Umbraco-CMS/tree/v8/contrib/src/Umbraco.Web.UI.Client/src/views/propertyeditors

    Good luck :)

Please Sign in or register to post replies

Write your reply to:

Draft