开发者

Is it possible to use conditional operator in checkbox using flex?

I want to fill color based on condition so I used conditional operator for the checkbox. But it's shows the error Implicit coercion of a value of type String to an unrelated type Array. What did I do wrong ? How can I dynamically change the color of a checkbox ?

开发者_StackOverflow中文版
<mx:CheckBox id="home" enabled="false"  fillColors="{(data.actualwin != '1') ? 
    '[#8CE912,#8CE912]' : '[#8CE912,#8CE912]'}"  selected="{data.betting_home=='1'}"/>


Try replacing

'[#8CE912,#8CE912]'

with

["#8CE912","#8CE912"]

or

[0x8CE912,0x8CE912]

(remove quotes)

You pass a string ('[#8CE912,#8CE912]') into a property where an array is expected


Or you can use an ItemRenderer

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜