Issue #865Opened February 14, 2018by byeonggukang0 reactions

[QUESTION] How can I set default tagName

Question

Hi ! I want to set tagName tr for all components(or specific component in use). Is there any predefined function to set tagName ?

Answers (3)

artfFebruary 18, 20180 reactions

You can change the tagName of any component, at any moment, in this way:

const component = editor.getSelected(); // I use a selected one just as an example
component.set('tagName', 'article');
// or on some group of components
const components = editor.DomComponents.getWrapper().find('div');
components.forEach(component => component.set('tagName', 'article'));

You can also change it at the component level, in this way any new one of its type will get it by definition. Read more about Components and how to extend them. Basically, you would create/extend a component with a custom tagName in this way:

comps.addType('you-component', {
	model: defaultModel.extend({
		defaults: { ... 
			tagName: 'tr'
		},
		...
	}),
	view: defaultView,
})
byeonggukangFebruary 19, 20180 reactions

works great! thanks @artf

Is there any way to change wrapper's tagName also?

lock[bot]September 18, 20190 reactions

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.