1
votes

I have a small flex datagrid. The dataProvider is an xmlList. I have two columns, userList and user permissions. The user permissions column as checkboxes. The values for the checkbox are stored as 0 and 1 in mySQL. While returning it from PHP, I am converting them to true or false. Its returning the values correctly to the frontend.

But inside the itemrenderer, the checkbox is not being set to true or false. Either everything is true or everything is false.

Here is my code. http://www.freeimagehosting.net/uploads/4ba76933d3.gif

How can I correctly set the value of the checkboxes from the DB values?

Please help.

1

1 Answers

2
votes

Change

<mx:CheckBox selected="{data.@selected}"/>

to

<mx:CheckBox selected="{Boolean(Number(data.@selected))}"/> (corrected thanx to Amarghosh)

and it should work fine.