Copied to clipboard

Flag this post as spam?

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


  • James Kahler 36 posts 78 karma points
    May 28, 2014 @ 13:06
    James Kahler
    0

    DialogService multipicker set selected nodes

    Building a custom property editor, in the controller i'm opening a treepicker via the dialogservice.

    When the treepicker is closed then reopened the selected nodes are no longer selected. How do i go about keeping them selected or re-selecting them when the treepicker is opened.

    var selected = [];
    
        $scope.openPicker = function () {
            var ds = dialogService.treePicker({
                callback: itemPicked,
                multiPicker: true,
                section: "content",
                treeAlias: "content",
                startNodeId: 1061,
                scope: $scope
            });
    
            function itemPicked(pickedItems) {
    
                angular.forEach(pickedItems, function (value, key) {
                    selected.push(value);
                });
    
            }
        }
    
  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 30, 2014 @ 09:56
    Jan Skovgaard
    0

    Hi James

    Think you need to tell the $scope to save the selected values by adding them to $scope.model.value.

    Try having a look at this post on Warrens blog where he describes how he created his first property editor using angularjs http://creativewebspecialist.co.uk/2013/08/23/how-i-built-my-first-property-editor-for-umbraco-belle/

    You should be able to figure it out by the code samples there I think.

    Hope this helps.

    /Jan

  • James Kahler 36 posts 78 karma points
    May 30, 2014 @ 10:38
    James Kahler
    0

    Thanks for the reply Jan

    I'm familiar with building a property editor it's just the dialogservice i'm struggling with.

    There doesn't seem any way to programatically set a node to be selected in a treepicker when it opens.

    I've hunted high and low to find examples of this but as yet I haven't found any, there are plenty of examples of using the dialogservice but none where nodes have been pre selected.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    May 30, 2014 @ 10:43
    Jan Skovgaard
    0

    Hi James

    Aaah, now I get what you mean...sorry about the misunderstanding.

    Yeah the documentation is a bit sparse - Hopefully more will be revealed during CG14 :)

    /Jan

  • P 32 posts 122 karma points
    Feb 05, 2016 @ 14:21
    P
    0

    I'm still having this issue - is there a solution?

    Pete

  • P 32 posts 122 karma points
    Feb 09, 2016 @ 10:02
    P
    0

    In the end, I sidestepped the issue by creating a custom "Item List" property and then only using the dialogPicker when I want to add an item.

Please Sign in or register to post replies

Write your reply to:

Draft