为 Flex dataGrid 的特定行设置样式

发布于 2024-09-10 06:03:31 字数 196 浏览 2 评论 0原文

我在 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 技术交流群。

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

发布评论

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

评论(1

三月梨花 2024-09-17 06:03:31

为每一列使用一个 itemRenderer。

在 itemRenderer 中,使用 DataGridListDataowner 属性来获取挂钩到 DataGrid 和 dataProvider。从那里开始进行比较,可能是在 dataChange 事件的侦听器中:

    if(this.listData.owner.dataProvider[this.listData.owner.dataProvider.length] == data){
 // Do Bold styling
} else {
 // don't do bold styling
}

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:

    if(this.listData.owner.dataProvider[this.listData.owner.dataProvider.length] == data){
 // Do Bold styling
} else {
 // don't do bold styling
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文