Getting back array items from property editor to grid property editor
Hi,
I have created a property editor named textboxWithIcon where a user can add an icon and textbox item (multiple items to grid)
Now on creation of grid property which has the textboxWithIcon property editor.
Grid property editor html
<umb-editor model="control.textWithIcon"/>
The actual property editor controller
umbraco.controller('Editors.TextBlockWithIconController', function ($scope, dialogService) {
if (!$scope.items) {
$scope.items = [];
}
$scope.addItem = function () {
let item = {};
$scope.items.push(item);
}
$scope.removeItem = function (index) {
}
$scope.setImage = function (key) {
dialogService.mediaPicker({
callback: function (data) {
$scope.items[key] = {
image: data.image
};
}
});
};
});
The grid property editor controller
umbraco.controller('Editors.CompositeTextBlockWithIconController', function ($scope) {
if (!$scope.control) {
$scope.control = {};
$scope.control.items = [];
}
if (!$scope.control.textWithIcon) {
$scope.control.textWithIcon = {
alias: 'textWithIcon',
label: 'iconWithText',
description: 'Icon with text',
view: '/App_Plugins/textBlockWithIcon.html'
};
}
$scope.$watch('control.textWithIcon.value', function (newValue) {
alert("undefined is shown here");
});
});
I am able to pick image and text in backend but on save it becomes empty and doesn't seem to persist.
The idea is to get back list of items (from the property editor to the grid ) and show it, which is essentially an array of images and corresponding text back into the grid control.
Getting back array items from property editor to grid property editor
Hi,
I have created a property editor named textboxWithIcon where a user can add an icon and textbox item (multiple items to grid)
Now on creation of grid property which has the textboxWithIcon property editor.
Grid property editor html
The actual property editor controller
The grid property editor controller
I am able to pick image and text in backend but on save it becomes empty and doesn't seem to persist.
The idea is to get back list of items (from the property editor to the grid ) and show it, which is essentially an array of images and corresponding text back into the grid control.
--umbraco 7 newbie
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.