未从数据库中选择 Flex 复选框值

发布于 2024-09-02 13:13:57 字数 426 浏览 2 评论 0 原文

我有一个小的弹性数据网格。 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事还在继续 2024-09-09 13:13:57

更改

Amargosh),

它应该可以正常工作。

Change

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

to

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

and it should work fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文