我有一个小的弹性数据网格。 dataProvider 是一个 xmlList。
我有两列,userList 和用户权限。用户权限栏
作为复选框。该复选框的值在 mySQL 中存储为 0 和 1。
从 PHP 返回它时,我将它们转换为 true 或 false。
它将值正确返回到前端。
但在 itemrenderer 内部,复选框未设置为 true 或 false。
要么一切都是真的,要么一切都是假的。
这是我的代码。
http://www.freeimagehosting.net/uploads/4ba76933d3.gif
我怎样才能根据数据库值正确设置复选框的值?
请帮忙。
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)
更改
将
为
它应该可以正常工作。
Change
<mx:CheckBox selected="{data.@selected}"/>
to
<mx:CheckBox selected="{Boolean(Number(data.@selected))}"/>
(corrected thanx to Amarghosh)and it should work fine.