Issue #1586Opened November 16, 2018by crypto-dump0 reactions

[Question] update Trait select option dynamically

Question

Code SnippetTEXT
I tried this to update trait selection.
var updateTrait = function(id, name) {

	var typeTrait = model.get('traits').where({name: 'type'})[0];
	var options = typeTrait.get('options');

	options.push({value: id, name: name});
	typeTrait.set('options', options);
};
But after click the element, it shows this error and the trait doesn't update.

![social attache local - edit templatereplacevalue1_en-us - google chrome 2018-11-16 02 39 55](https://user-images.githubusercontent.com/35139226/48586277-edb85d80-e948-11e8-863e-4eaaad7b5766.png)

Answers (2)

AkibDeraiya123February 13, 20190 reactions

Hey @boris1989529 I am also stuck at this point to update the traits dynamically even in scenario i also need to push the option into the once of my trait.

Did you got any solution for this? It would be your pleasure if you can share the solution for me if you found. Thanks in advance.

lock[bot]February 13, 20200 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.