How we can set array using editor.getSelected().set('attributes',array value)
Question
Hi @artf,
How we can set array values using editor.getSelected().set('attributes',array value); If we try to do so with the same code then it insert NaN to attributes.
Answers (3)
@Deepak813 ,
You should follow one of the following syntaxes:
-
editor.getSelected().set({title: "March 20", content: "In his eyes she eclipses..."});-> for multiple attributes. You send a object -
editor.getSelected().set("title", "March 20");-> for a specific attribute
How we can set array values using editor.getSelected().set('attributes',array value);
You can't set array on attributes property, it should be an object instead.
I'd recommend using a more specific methods like model.setAttributes({ title: '' }) or addAttributes({ ... })
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 #771
Image src is not updating
Hi @artf, I have updated the image src using below code: editor.getSelected().set('attributes', {'src': image_Url}); but when i set all the...
Issue #740
How to remove class from html
Hi @artf, We are updating the <i> tag class but it adds new class to this but previous class is not remove.please let us know how to remove...
Issue #1163
[Question] How do I set <body> attributes
Hi @artf, On the previous issue #1132 about export <body my="attributes"> code, I think it's done using exportWrapper: true. But now experi...
Issue #1534
Update property Input value from model style.
@artf I want to update height of the element and want to give a custom height using following code It's working fine and it's update the se...
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.