Custom Property Editor with Archetype - fails silently
Has anyone had any issues creating custom property editors for use with Archetype?
I've found that I need to hook on the alias of the element created - this was my first breakthrough (and I then found it was in the documentation!) and works for multiple instances of the editor on a doc type... next I came to test using it in Archetype.
After a lot of swearing I found that if I add a timeout delay in the controller of the CPE the editor works as expected - without it the first instance in the archetype works but the subsequent ones don't. It seems to be an issue in that the hook onto the input field fails silently (like it hasn't yet been created in the DOM before the call to the controller takes place).
angular.module("umbraco")
.controller("My.FileUploader",
function ($scope, assetsService) {
// this hack adds a delay to allow archetype to create the elements or the hook onto the fileupload field seems to fail silently?
setTimeout(function() {
assetsService
.load([
// load js assets
])
.then(function () {
$('#' + $scope.model.alias + '-fileupload').fileupload({
... code to fire up fileupload
},
});
});
}, 100);
});
Custom Property Editor with Archetype - fails silently
Has anyone had any issues creating custom property editors for use with Archetype?
I've found that I need to hook on the alias of the element created - this was my first breakthrough (and I then found it was in the documentation!) and works for multiple instances of the editor on a doc type... next I came to test using it in Archetype.
After a lot of swearing I found that if I add a timeout delay in the controller of the CPE the editor works as expected - without it the first instance in the archetype works but the subsequent ones don't. It seems to be an issue in that the hook onto the input field fails silently (like it hasn't yet been created in the DOM before the call to the controller takes place).
Am I doing something silly in my controller?
I've solved this in my other thread.
https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/79035-knowing-when-the-umbraco-backoffice-has-finished-creating-all-properties-and-loaded-data
is working on a reply...