Copied to clipboard

Flag this post as spam?

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


  • Martin 278 posts 662 karma points
    Jan 20, 2015 @ 11:42
    Martin
    0

    Custom Property Editor - Grid

    Hi all, I'm new to angular & struggling to create a property editor within the grid.

    I'm trying to build a simple content picker button that can be dropped into the grid. It has two values of label and link.

    I have the functionality of adding the button through the grid editor, but im struggling with the property editor itself, specifically the controller.

    Im trying to get the treepicker to work and not having any luck. Im getting the dialog window expanding & the content tree, but i cant save the selected tree node.

    Is there any similar simple tutorials or help I could ask for.

    Thanks Martin

    manifest

    {
        propertyEditors: [      
            {
                alias: "Button Editor",
                name: "buttonEditor",
                editor: {
                    view: "~/App_Plugins/ButtonEditor/ButtonEditor.html",
                    valueType: "JSON"
                }
            }
        ],
        javascript:[
            "/App_Plugins/ButtonEditor/ButtonEditor.controller.js"
        ]
    }
    

    controller

    angular.module("umbraco").controller("buttoneditor",
    function ($scope, $http, dialogService) {
    
        $scope.contentPicker = function (button) {
            dialogService.treePicker({
                multiPicker: false,
                section: "content",
                treeAlias: "content",
                callback: function (data) {
                    button.link = { id: data.id };
                }
            });
        };
    
    });
    

    view

    <div ng-controller="buttoneditor">
        <input type="text" ng-model="control.value" />
        <input type="button" value="Content Picker" ng-click="contentPicker(button)"  />
    </div>
    
  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Jan 20, 2015 @ 12:08
  • AJS 31 posts 212 karma points
    Nov 25, 2015 @ 20:21
    AJS
    0

    Hi Martin,

    Did you ever figure out how to do this?

    Thanks!

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Nov 25, 2015 @ 20:42
    Dennis Aaen
    0

    Hi Amanda,

    If you have access to Umbraco TV, then we have a chapter about how to build your own grid property editors.

    http://umbraco.tv/videos/umbraco-v7/developer/extending/property-editors

    This might help you.

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft