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:
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.
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?
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
Hey, this is not solved, yet.
is working on a reply...