Flex 高级数据网格条件行背景颜色
我正在尝试为 Flex 3 中的高级数据网格控件设置行背景颜色。有谁知道这是否可以使用样式函数。 目前我的样式函数如下所示:
public function myStyleFunc(data:Object, col:AdvancedDataGridColumn):Object
{
if (data["status"] == "PRICING")
return {color:0xFF0000 , fontWeight:"bold" , backgroundColor:0xFF0000};
// Return null if the Artist name does not match.
return null;
}
但是背景颜色不会改变。
我听说葡萄藤上我可能需要重写一些方法来启用背景颜色属性。
任何帮助,将不胜感激 。
问候卡尔
I am trying to set the row background color for the advanced data grid control in Flex 3. Does anyone know if this is possible using a style function. Currently my style function looks like:
public function myStyleFunc(data:Object, col:AdvancedDataGridColumn):Object
{
if (data["status"] == "PRICING")
return {color:0xFF0000 , fontWeight:"bold" , backgroundColor:0xFF0000};
// Return null if the Artist name does not match.
return null;
}
However the background color does not change.
I have heard on the grape vine that I may need to override some methods to enable the background color property.
Any help would be appreciated .
Regards Karl
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经做过类似的事情,但就我而言,颜色也来自数据,但这会对您有所帮助。
您必须重写 Datagrid 并重写 drawRowBackground 方法
通过此方法,您可以从行中获取任何数据,并根据它给出颜色。
I have done some thing like that but in my case color was also coming from data also but it will help you.
You have to override the Datagrid and override drawRowBackground method
By this you can get any data from the row and according to it give the color.