Help wanted : Search child models of domComponent
Question
Hello,
I have to change content of nth child model of component available in the editor. Lets say there is a table with 3 TR. every TR as TD and every TD has div with some content within in it. I want to replace that content with some other content.
I have assigned some custom html tags to every div. How do i find that div from models and change the content such a way that model is updated.
I have done this thing with JS, On the editor it is shown as new content but in Model it is showing old content.
Can you please help me out.
Thanks,
Answers (2)
@vishal5033 you can make use of model.find('tr > td[something]')[0], in this way you get the model (use the v0.12.60 as it fixes some stuff related to find)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #563
Table <thead> and <tbody> tag gets Omitted
Hello, There is new issue with GrapesJS (maybe). I've created new component using bm.add() in which I've used a table element with <thead>...
Issue #1493
[QUESTION] render() works on the first time but not on subsequent calls
Hello, I've created a custom component that shows images using background-image on a <div> instead of using an <img> element. It's mostly w...
Issue #701
Modifying a component in the editor clears the model content
What I'm trying to achieve: I have special "data-" attributes on some of the components I pull into the editor. When one of these is modifi...
Issue #1236
[HELP WANTED] I can not use ckeditor 5 with grapesjs
Hello, Arthur and contributors! I'm creating a plugin for using CKEditor 5 in grapesjs, based on the grapesjs-plugin-ckeditor already avail...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.