为 Flex dataGrid 的特定行设置样式
我在 Flex 中有一个 dataGrid 组件。我的网格有几行。
我只想将最后一行设为粗体。我只是不知道该怎么做。
我想到了一个想法:创建一个获取参数的工厂,以便我可以向 itemRenderer 传递总行数。但是,我不知道如何检查 itemRenderer 本身中的当前行(并将其与总行数进行比较)。
我的方向正确吗?有没有简单的方法?
谢谢,
I have a dataGrid component in flex. My grid has few rows.
I simply want to make the last row bold. I just can't figure how to do it.
I thought about an idea : create a factory that gets parameters so that i can pass the itemRenderer the total count of rows. But, i don't know how to check the current row in the itemRenderer itself (and compare it to the total rows).
Am i in the right direction? Is there a simple way?
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为每一列使用一个 itemRenderer。
在 itemRenderer 中,使用 DataGridListData。 owner 属性来获取挂钩到 DataGrid 和 dataProvider。从那里开始进行比较,可能是在 dataChange 事件的侦听器中:
Use an itemRenderer for each column.
In the itemRenderer, use the DataGridListData.owner property to get a hook to the DataGrid, and the dataProvider. From there just do a compare, probably in a listener to the dataChange event: