Issue #842Opened February 6, 2018by Deepak8130 reactions

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)

arthuralmeidapFebruary 6, 20180 reactions

@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

artfFebruary 7, 20180 reactions

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({ ... })

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.