I can't seem to figure out how to add a media picker to my custom grid editor.
I have a grid editor that takes a header, a description, and an optional background image. The header and the description works fine, but I can't seem to trigger the media picker from my angular controller.
I've taken inspiration from this post, but getting the following error when opening the content node that includes this grid editor:
Request error: The URL returned a 404 (not found):
views/common/overlays/mediapicker/mediapicker.html
Has this changed in version 8 of Umbraco, or have I misunderstood something?
Media picker in grid editor
Hello.
I can't seem to figure out how to add a media picker to my custom grid editor.
I have a grid editor that takes a header, a description, and an optional background image. The header and the description works fine, but I can't seem to trigger the media picker from my angular controller.
I've taken inspiration from this post, but getting the following error when opening the content node that includes this grid editor:
Has this changed in version 8 of Umbraco, or have I misunderstood something?
Found the solution myself. It appears you need to inject the
editorService
service.The media picker can be triggered with the following function:
As well as handling the media picker submit to set the image:
Any chance you have sample code on Github??
This answer really helped in me completing my custom grid editor. Please check out https://our.umbraco.com/forum/using-umbraco-and-getting-started/100699-media-picker-custom-grid-controls#comment-315807 for complete answer
is working on a reply...