Copied to clipboard

Flag this post as spam?

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


  • Nikhil Prajapati 19 posts 131 karma points
    Sep 01, 2022 @ 10:50
    Nikhil Prajapati
    0

    Nested content with Grid editor issue while update content and preview

    Hello Everyone,

    I got stuck in one issue with the grid editor. So, I have this scenario here,

    I have created content blocks using the nested content inside the grid editor. Everything is working fine, I am able to add/update, etc.

    Now, When I am trying to perform the below steps, I am facing issues like opening or updating the content panel.

    So, here are the steps, I am trying...

    Steps:

    1. I have opened - “Item 1”, Edited one of the Content blocks (save/cancel, doesn’t matter).
    2. Then I opened - “Item 2”, and interacting with Item 2’s content does not seem to have any impact on it.
    3. Now, I am trying to reopen “Item 1”, (Or open either the previous Content or another that was not touched previously)
    4. So, now I am getting the edited panel as a blank, It is not loading anything in it. [Screeenshot attached]

    enter image description here

    Right now, The only way is I have to refresh the page.

    I am not sure If anyone else faced this issue.

    Looking forward to hearing from the friendliest people.

  • Nikhil Prajapati 19 posts 131 karma points
    Sep 22, 2022 @ 10:48
    Nikhil Prajapati
    101

    Hello,

    I got solution for this issue, I have just updated below code in umbraco.controller.js file.

    $scope.initControl = function (control, index) {
            control.$index = index;
            control.$uniqueId = $scope.setUniqueId();
            //error handling in case of missing editor..
            //should only happen if stripped earlier
            if (!control.editor) {
                control.$editorPath = 'views/propertyeditors/grid/editors/error.html';
            }
            if (!control.$editorPath) {
                var editorConfig = $scope.getEditor(control.editor.alias);
                if (editorConfig) {
                    control.editor = editorConfig;
                    //if its an absolute path
                    if (control.editor.view.startsWith('/') || control.editor.view.startsWith('~/')) {
                        control.$editorPath = umbRequestHelper.convertVirtualToAbsolutePath(control.editor.view);
                    } else {
                        //use convention
                        control.$editorPath = 'views/propertyeditors/grid/editors/' + control.editor.view + '.html';
                    }
                } else {
                    control.$editorPath = 'views/propertyeditors/grid/editors/error.html';
                }
            }
            else {
                var editorConfig = $scope.getEditor(control.editor.alias);
                if (editorConfig) {
                    control.editor = editorConfig;
                } else {
                    control.$editorPath = 'views/propertyeditors/grid/editors/error.html';
                }
            }
        };
    

    Hope this can help!!!

Please Sign in or register to post replies

Write your reply to:

Draft