Issue #1779Opened February 7, 2019by Soharab-Shaikh0 reactions

Traits type Checkbox not checked from the initialization of the Component type.

Question

Hi, Artur

When I try to check traits (type: checkbox) from the init() of the domCom Type the value set as true but not checked. Code:

traits: [
{
    type: 'checkbox',
    label: 'Display Pagination',
    name: 'pagination',
    changeProp: 1
}
]
....
init()
{
	var pagination = this.get('traits').where({ name: 'pagination' })[0];
	**var paginationData = "true";    //(can came from DB)**
	pagination.set('value', paginationData == "true" ? true : false);
}

image

Thanks man for your great work

Answers (3)

artfFebruary 8, 20190 reactions

The trait reads from the component, edit the component itself not the trait value. this.set('pagination', paginationData == "true" ? true : false)

Soharab-ShaikhFebruary 8, 20190 reactions

No, I just want to checked the trait not the componen y.

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