I ran the following code:
Instance.CheckboxGroup_1.optionItems=‘a|a;b|b;c|c’;
await Instance.CheckboxGroup_1.render();
Instance.CheckboxGroup_1.checkedIndexes=[0,1];
After the page renders, items a and b are not checked on the UI. How can I resolve this issue?
I Test the CheckGroup_A:
const checkboxGroup = new TComponents.CheckboxGroup_A(this.container.querySelector(‘.layout-infobox-content’), {
position: ‘absolute’,
zIndex: 1000,
optionItems: `text1|value1;\ntext2|value2;\ntext3|value3`
});
await checkboxGroup.render();
checkboxGroup.selectedIndexes = [0, 1];
Show OK
but I add on the end
checkboxGroup.onChange= async function() {
console.log(‘Checkbox group changed.’, this.color);
};
It stops working immediately upon display.
const checkboxGroup = new TComponents.CheckboxGroup_A(null, {
position: ‘absolute’,
zIndex: 1000,
optionItems: `text1|value1;\ntext2|value2;\ntext3|value3`
});
await checkboxGroup.render();
// Set the selected indexes
this.appendChild(checkboxGroup); // this is a layoutInfoBox
checkboxGroup.selectedIndexes = [0, 1];
Not Work
If the initial value has been configured in the property panel on the UI,
Instance.checkboxGroup_1.selectedIndexes = [0, 1]; Show OK
However, checkedIndexes does not work at all only after dynamically setting the options.
This leaves me at a loss. I normally avoid commenting on component quality, but this implementation is really poorly done.



