我想动态更新列表选择器项。我设置列表选择器小部件,如下所示
this.ConversionToNumaric= [ {label:$L('One'), value:"1", secondaryIcon:''},
{label:$L('two'), value:"2", secondaryIcon:''},
{label:$L('three'), value:"3" , secondaryIcon:''}
]
this.controller.setupWidget('listSelectorConversionToNumaric', {labelPlacement:'left',label: $L('To'), choices: this.ConversionToNumaric, modelProperty:'currentConversionToNumaric'}, this.selectorsModel);
the above code i am using for setup the widget
this.ConversionToNumaric= [ {label:$L('four'), value:"4", secondaryIcon:''},
{label:$L('five'), value:"5", secondaryIcon:''}
]
]
this.currentConversionToPower.choices=this.ConversionToNumaric;
this.controller.modelChanged(this.currentConversionToNumaric);
我在这里犯了什么错误我不知道但是没有更新请帮帮我
答案 0 :(得分:0)
我得到了解决方案。我没有更新模型我正在更新别的东西
这就是我遇到问题的方式。我使用this.selectorModel
解决了这个问题this.selectorsModel = this.ConversionToNumaric; this.controller.modelChanged(this.selectorsModel);