DataGrid 中的删除线
给定一些规则,我想删除 DataGrid 中的整行。是否可以?
Given some rule I want to strike through an entire row in a DataGrid. Is it possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
给定一些规则,我想删除 DataGrid 中的整行。是否可以?
Given some rule I want to strike through an entire row in a DataGrid. Is it possible?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
实现这项工作的最可靠的方法是使用自定义项目渲染器,其中重写 OnUpdateDisplay 函数,您使用图形对象基于布尔值在数据网格项目的标签之间绘制一条水平线范围。
如果您愿意,我可以为标签写下类似的内容,但您必须弄清楚使其与 Datagrid 项目组件一起工作的内部原理。
如果您希望我粘贴标签示例,请告诉我。
编辑(粘贴示例)
创建一个新的flex项目,添加一个扩展标签的新类。该类的名称是StrikeThroughLabel。现在将其放入默认包中(即将包字段留空)
完成后,进入 main.mxml 并使用 mxml 后面的代码:
上面显示了一个按钮和一个标签,单击按钮会切换标签上的删除线。
请注意,现在删除线是对角线的,但只需在登录绘制线时进行一些调整,您就应该得到水平删除线。
The most robust way to make this work , would be to use a custom item-renderer, where overriding the OnUpdateDisplay function, you use a graphic object to draw a horizontal line right between the label of the data-grid item, based on a boolean parameter.
I can write down something like this for a label if you want, but you will have to figure out the internals of making it work with the Datagrid item component.
Please let me know if you want me to paste an example for label.
EDIT (PASTING EXAMPLE)
Create a new flex project, add a new class which extends label.The name of the class is StrikeThroughLabel .Put this in the default package as of now (i.e leave the package field empty)
Once thats done, come to your main.mxml and use the code that follows for mxml:
The above shows you a button and a label, clicking on the button toggles the strikethrough on the label.
Please note, right now the strike-through is diagonal, but just a few tweaks with the login of drawing the line, and you should get a horizontal strike-throught.
我不确定这是否有帮助,但我只想到这个。
CObj 类
Am not sure if this help or it , but only this one comes to my mind.
CObj Class