Issue #1624💬 AnsweredOpened November 30, 2018by crypto-dump0 reactions

Replace html issue

Quick answerby artf

You should change the model of the component, not its view

Read full answer below ↓

Question

I defined new forum block like this. I want to replace resource class with ajax response html. Currently I did it like this. The problem is Hover is not working after this replacing. The data contains several div tags. I want to make hover action working correctly for the forum_directory class.

Answers (3)

artfDecember 1, 2018

You should change the model of the component, not its view

if (model) {
	const resourceModel = model.find('.resource')[0];
	resourceModel.components(data);
}
crypto-dumpDecember 4, 2018

Thanks. It's working fine. But I want to add attribute something like data-gjs-selectable: false, data-gjs-editable:false to this resourceModel

artfDecember 7, 2018

You can resourceModel.set({ selectable: false, editable: false })

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.