Issue #753πŸ’¬ AnsweredOpened January 12, 2018by vishal50330 reactions

Help wanted : Search child models of domComponent

Quick answerby artf

@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)

Read full answer below ↓

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)

artfβ€’ January 13, 2018

@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)

lock[bot]β€’ September 18, 2019

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

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.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.