Event listening for loaded asset
I got it with update target updateTarget(trgt) { const image = this.model; const dirName = image.attributes.src; const filename = dirName.replace('https://d3d4x44eptevwm.cloudfront.net/md/',''); trgt.set('attributes', { src: https://d3d4x44eptevwm.cloudfront.net/md/${filename}, srcSet: https://d3d4x44eptevwm.cloudfron...
Read full answer below βQuestion
I need to find a way to expose the event listener when an image has been selected in the Asset Manager, is there a way to do it? I can only see event listeners when the image is uploaded, not selecting a pre-defined asset.
Thanks
Answers (1)
I got it with update target updateTarget(trgt) { const image = this.model; const dirName = image.attributes.src; const filename = dirName.replace('https://d3d4x44eptevwm.cloudfront.net/md/',''); trgt.set('attributes', { src: https://d3d4x44eptevwm.cloudfront.net/md/${filename}, srcSet: https://d3d4...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2516
Asset manager alert
Hi, thanks for the wonderful editor, I Tried to integrate the editor and everything is Fine. When the user selects an image from the asset...
Issue #2408
Event listener for undo?
I am listening for a component delete and move with removed() and sorter:drag:end. One last way (I hope) that I see the component move is b...
Issue #3415
Custom Asset Manager. How to set bg image
Hi there! I'm building a custom modal for the Asset Manager and basically, it seems that I need to override command. How I can understand i...
Issue #1462
Uploaded image error
We have gotten GrapesJs integrated into our Angular application. We have the asset manager showing a list of images that have been uploaded...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βRelated tutorials
In-depth guides on the same topic.
Tutorial
How to Build an AI-Powered Page Builder with GrapesJS in 2026
What we learned building GJSDocs β from simple AI text generation to structured, context-aware visual editing
Tutorial
How Much Does It Cost to Build a SaaS Page Builder in 2026?
How much does it cost to build a SaaS page builder in 2026? Explore realistic development costs, timelines, features, and how using GrapesJS can reduce
Tutorial
UnStudio for GrapesJS: 4 Plugins to Build Better Visual Editors
Meet UnStudio, a new GrapesJS plugin studio with four tools, safer and better editor: Command Palette, Responsive Pack, Autosave & Restore, and Autofill
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.