有没有好的方法可以在flex中获得三态复选框?
我在互联网上进行了很好的搜索,但似乎找不到任何三态复选框的示例。 SDK 似乎不支持它,而且我在网上找不到任何示例。
我想这是一个常见问题,在我开始编写自己的之前,有人知道我可以在某个地方使用一个好的弹性三态复选框组件吗:)
干杯,
Jawache。
I've had a good rummage around the interweb and can't seem to find any examples of a tri-state checkbox. It doesn't look to be supported in the SDK and I can't find any examples online.
I would imagine this is a common problem, before I embark on writing my own does anyone know of a good flex tri-state checkbox component somewhere I can use :)
Cheers,
Jawache.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
此处发布了一个示例 Flex Cookbook。 您可以通过此代码轻松创建自己的组件。
There is an example posted here on Flex Cookbook. You can easily create your own component from this code.
对于后来遇到此问题的其他人,我制作了自己的自定义组件,该组件仅隐藏第三状态的复选框,并将其替换为看起来像第三状态下的复选框的图像。 这真的很容易实现:
For others who come across this later, I made my own custom component that just hides the checkbox for the third state and replaces it with an image that looks like a checkbox in the third state. This is really easy to implement:
这是我自己的版本,灵感来自詹姆斯的版本。 您可以启用/禁用三态以获得具有相同组件的经典复选框,并且使用的机制有点不同,样板较少。 嵌入图片位于此处。
使用风险自负! :)
Here is my own version inspired by James' one. You can enable / disable tristate to get a classic checkbox with the same component, and the mechanism used is a bit different, with less boilerplate. Embedded picture is here.
Use at your own risks ! :)
看看 http:// srinichekuri.wordpress.com/2011/05/20/3-state-checkbox-for-headerrenderer-in-datagrid/。
它具有 3 状态复选框的代码。
Take a look at http://srinichekuri.wordpress.com/2011/05/20/3-state-checkbox-for-headerrenderer-in-datagrid/.
It has the code for 3 state check box.