Saving custom property editor values (v13, newby t...
# help-with-umbraco
c
Hey all, So ive been doing a bit of extending of the Umbraco backoffice recently, and am currently in the process of making a bit of a dynamic filter system. To get it working I needed to create a custom property editor as nothing OOTB would handle what I was trying to achieve. As such the following screenshot view was born! I'm however, slightly struggling with the concept of saving the values on the node through this new property editor. Happy to share the code I have thus far, however its quite "long" so it'll probably end up in a discord file as opposed to a viewable code block. If anyone can give it a once over and tell me "Your being dumb, you should be doing it X way" that would be greatly appreciated 😅 https://cdn.discordapp.com/attachments/1290340984592404562/1290340984886132789/image.png?ex=66fc1b30&is=66fac9b0&hm=cd023f524c908dcd76d087951210531b04dca7c3c6ae6074b95d8dcf18680808& https://cdn.discordapp.com/attachments/1290340984592404562/1290340985087201392/message.txt?ex=66fc1b30&is=66fac9b0&hm=9bffe4f07ab26ab2e7dda72ea587c937eab9d67190ad9071194164275969dbc8&
k
Setting
$scope.model.value
should be enough, and your code does that... can you verify that that code runs, with the correct data? There is an
angular.copy
to the value, but also regular assignments. We've based our most recent editors on examples that use
editorService.open
to open the editor flyout, so there's not much code in the controller, most is in the view. The controller just passes "current data" and receives "updated data".
c
Hey @kdx-perbol Indeed - The code certainly runs and values save. Have only encountered one bug with my code where a node that existed before I added in this new property editor refused to update its state at all. Im putting it down to some sort of scope invalidation / corruption as I could not find the reason why this one particular node just "didnt care" what I had selected. Was just a bit worried I might be doing this incorrectly 😄
k
This works completely differently in 14, so I wouldn't overwork it. 🙃
c
Oh yeah, i'm looking forward to the swap to web components. Sadly we are sticking with the LTS's only so wont be a while till I see them 😅
10 Views