[英]Is it possible to use conditional operator in checkbox using flex?
我想根据条件填充颜色,因此我为复选框使用了条件运算符。 但这显示了将Implicit coercion of a value of type String to an unrelated type Array
。 我做错了什么 ? 如何动态更改复选框的颜色?
<mx:CheckBox id="home" enabled="false" fillColors="{(data.actualwin != '1') ?
'[#8CE912,#8CE912]' : '[#8CE912,#8CE912]'}" selected="{data.betting_home=='1'}"/>
尝试更换
'[#8CE912,#8CE912]'
与
["#8CE912","#8CE912"]
要么
[0x8CE912,0x8CE912]
(删除引号)
您将字符串('[#8CE912,#8CE912]')传递到需要数组的属性中
或者您可以使用ItemRenderer
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.