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);
});
}
}
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.
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.
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
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.
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
I'm still having this issue - is there a solution?
Pete
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.
is working on a reply...