Copied to clipboard

Flag this post as spam?

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


  • Andrei 68 posts 130 karma points
    Nov 20, 2014 @ 13:36
    Andrei
    0

    GetGridHtml() fails when custom property editor used

    Hi guys,

    I have an annoying issue with v7.2 beta. 

    I build a custom property editor for the grid, but when I save some data with it, then GetGridHtml("grid") will return empty. I feel I'm missing something and documentation on the web is not very helpful.

    The json saved by my custom property looks like this:

    { "value":
    {
    "teaserImage": null, 
     "headerText": "test title here", 
     "text": "test text here"
     }, 
     "editor": {
     "name": "Vertical Teaser",
     "alias": "verticalTeaser",
     "view": "/app_plugins/verticalteaser/editor.html",
     "icon": "icon-code",
     "config": { "color": "red", "text-align": "right" }
     }
     }

    which is pretty much standard as compared to other saved values.

    I also have a partial in /Views/Partials/Grid/Editors/verticalTeaser.cshtml

    However GetHtmlGrid() is silently failing and there is no clue about the error in the log files or anywhere. Any idea?

  • Andrei 68 posts 130 karma points
    Nov 20, 2014 @ 16:57
    Andrei
    100

    Found the problem eventually:

    It's in bootstrap.cshtml (\website\Views\Partials\Grid\bootstrap3.cshtml), the view that renders the grid. If I change this line:

    string editor = "grid/editors/" + control.editor.view.ToString();
    to
    string editor = "grid/editors/" + control.editor.alias.ToString(); 

    then it will work (assuming you have a renderer view file with same name as alias under \website\Views\Partials\Grid\editors).

    Don't know if this is a bug or I'm missing documentation, but it looks like a bug, because the value in "control.editor.view" will usually look something like:

    "/app_plugins/yourpackage/youreditor.html" and when prefixed with "grid/editors" it will result in a wrong path for the rendering view.

    Maybe an umbraco 'guru' could bring some light over this issue as I find this documentation for this lacking:
    http://our.umbraco.org/documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Grid-Layout 

     

  • Andrei 68 posts 130 karma points
    Dec 17, 2014 @ 18:48
    Andrei
    0

    Hey, this is not solved, yet.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies