Model and returned html issue
@krunal039 It's not an issue, it's just how you've defined a custom type. If you define traits on div you will get them there. If you need to update some nested component you can always access it from the component itself
Read full answer below βQuestion
I have below code to create custom component and wants to retrieve updated html via editor.html() but return wrong html, I am sure I am missing something again. we need below template returned 482 Codeplex: Template function createPCBoxComp(comps, defaultModel, defaultView) { comps.addType('pcBox', { // Define the Model model: defaultModel.extend({ // Extend default properties defaults: Object.assign({}, defaultModel.prototype.defaults, { droppable: false, void: 0, src: '', hoverText: 'Link to curriculum page', title: ' Curriculum Link', ahref: 'https://team.global.test/sites/testUni', target...
Answers (3)
@krunal039 It's not an issue, it's just how you've defined a custom type. If you define traits on div you will get them there. If you need to update some nested component you can always access it from the component itself
const linkModel = model.components().at(0);
...
@artf thanks for reply, if you can please point me to any sample?
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 #1157
Return span randomly in custom component
I have custom component and on trait change wanted to updated html but randomly it returned span/textnode in trait change function insted o...
Issue #527
Model and HTML return issue
#522 @artf I tried as you said but still no luck, I do not want to waste your time but it would be very useful if you can please create sma...
Issue #1198
QUESTIONS : Find element in Model
I have custom component and it render below html, I want to update value of h4 tilte and other element on trait changed, but not sure how c...
Issue #482
Default asset manager in custom component
I am in process to create custom component for below template and we want to have user enter text,link,hover text and select image and want...
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.