Copied to clipboard

Flag this post as spam?

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


  • Yehonatan Anabi 9 posts 119 karma points
    Jan 14, 2016 @ 10:34
    Yehonatan Anabi
    0

    Rendering Umbraco.Grid datatype in custom section

    Hi all,

    I've been trying to add Grid to my custom section for a while without success.

    This is what i get

    To Render the grid i Use (Best / Working sulotion so far):

    <div class="umb-editor umb-grid" ng-controller="Umbraco.PropertyEditors.GridController" auto-scale="10">
        <ng-include src="'/umbraco/views/propertyeditors/grid/grid.html'"></ng-include>
    </div>
    

    I didn't find any article about initializing the grid.

    Help would be appreciated!

  • Yehonatan Anabi 9 posts 119 karma points
    Jan 14, 2016 @ 12:14
    Yehonatan Anabi
    0

    I had a progress by initializing $scope.model.value with this:

                $scope.model = {
                value: {
                    name: "לךחי",
                    sections: [
                    {
                        "grid": 12,
                        "rows": [
                          {
                              "name": "3 חלקים",
                              "areas": [
                                {
                                    "grid": 4,
                                    "controls": [
                                      {
                                          "value": {
                                              "macroAlias": "ContactWidgetMacro",
                                              "macroParamsDictionary": {
                                                  "Title": "יצירת קשר"
                                              }
                                          },
                                          "editor": {
                                              "name": "Macro",
                                              "alias": "macro",
                                              "view": "macro",
                                              "render": null,
                                              "icon": "icon-settings-alt",
                                              "config": {}
                                          }
                                      }
                                    ]
                                }
                              ],
                              "id": "933d1b8c-46aa-e0a0-5830-426c2aab29c0"
                          }
                        ]
                    }]
                },
                config: {
                    items: {
                        columns: "12",
                        styles: [
                          {
                              "label": "Set a background image",
                              "description": "Set a row background",
                              "key": "background-image",
                              "view": "imagepicker",
                              "modifier": "url({0})"
                          }
                        ],
                        config: [
                          {
                              "label": "Class",
                              "description": "Set a css class",
                              "key": "class",
                              "view": "textstring"
                          }
                        ],
                        templates: [
                          {
                              "name": "1 column layout",
                              "sections": [
                                {
                                    "grid": 12
                                }
                              ]
                          },
                          {
                              "name": "2 column layout",
                              "sections": [
                                {
                                    "grid": 4
                                },
                                {
                                    "grid": 8
                                }
                              ]
                          }
                        ],
                        layouts: [
                          {
                              "name": "Headline",
                              "areas": [
                                {
                                    "grid": 12,
                                    "editors": [
                                      "headline"
                                    ]
                                }
                              ]
                          },
                          {
                              "name": "Article",
                              "areas": [
                                {
                                    "grid": 4
                                },
                                {
                                    "grid": 8
                                }
                              ]
                          }
                        ]
                    },
                    editor: { }
                }
            }
    

    but this configuration is not fully configured, what else do i need?

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jan 15, 2016 @ 06:36
    David Brendel
    0

    Think the besteht would be to get the actuall Konfiguration from a data type itself.

    At least that works with the other ones like datepicker. Haven't tried it with the grid. But should be the same.

    Without proper config the editors just don't work.

    Can't provide some code right now as i'm in mobile (and haven't tried it with grid).

    Regards David

  • Yehonatan Anabi 9 posts 119 karma points
    Jan 18, 2016 @ 21:13
    Yehonatan Anabi
    100

    I found grid test configuration that helped me alot!

    navigate to:

    {Project}\umbraco\Js\umbraco.testing.js
    

    Hope that i helped somebody

Please Sign in or register to post replies

Write your reply to:

Draft