Image not change while we fetch html using editor.getHtml()
You didn't show any code but I guess you've just edited DOM elements of the component when instead you should change its Component model data (eg. imgModel.set('src', 'base64....'))
Read full answer below ↓Question
Hello @artf I am using grapes.js for my website-builder tool into my website. While i double click on any image the asset-manager will open and i can choose the image from asset-manager. Now thing is that i putted the conditions like once user will choose any image from asset-manager i will replace that img tag with div tag and initialise one image-editor (It's cropper.js) at there. Now once i close the asset manager after selection of image the new path of image is set and also the new div will also set instead of img tag. Once user will click on done button inside the editor(i mean image ed...
Answers (3)
You didn't show any code but I guess you've just edited DOM elements of the component when instead you should change its Component model data (eg. imgModel.set('src', 'base64....'))
Hello @artf Thank you for your reply on my query. I am attaching my code here, please let me know at where i am going wrong. So, basically above code will be run while user will double-click on particular image. In this function i am going to add one random generated id attribute in selected image....
In this function right now i am changing the image
srcusing jQuery which is working fine. But when i geteditor.getHtml()It's not reflacted.
... @AkibDeraiya123 this is exactlly what I told you in my previous comment... DON'T EDIT the DOM with JQuery... edit the model as I told you
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1719
Event while click on image from asset modal
Hello @artf , Hope you are doing well. I am working on asset-manager. I have total 5 images as a default asset-manager image. I want to do...
Issue #1660
Content will automatically removed while edit in editor
Hello @artf I am facing an issue with grapes.js while editing any textual content. I am using grapes.js Version 0.14.37 with angular 1.6.1....
Issue #1817
Change HTML content while block is render in editor
Hello @artf I have one block into block manager like As per above script inside the block, i want to add dynamic HTML content while this bl...
Issue #1780
How to change extra dropdown for link change trait
Hello @artf , I want to give one more functionality to user like user can change any link with default links drop down. In above image i wa...
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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.