Flex DataGrid行自定义颜色
发布时间:2020-12-15 03:48:41 所属栏目:百科 来源:网络整理
导读:原文地址:http://www.voidcn.com/article/p-exrptndp-wo.html 以前在Flex开发中用到了表格要自定义行颜色的情况。 /** * ActionScript file * @author chenjiahui */ package com.xxx.dm.module.jsjhcNew{ import flash.display.Sprite; import mx.controls
原文地址:http://www.voidcn.com/article/p-exrptndp-wo.html 以前在Flex开发中用到了表格要自定义行颜色的情况。 /** * ActionScript file * @author chenjiahui */ package com.xxx.dm.module.jsjhcNew { import flash.display.Sprite; import mx.controls.AdvancedDataGrid; public class RowColorAdvancedDataGrid extends AdvancedDataGrid { public function RowColorAdvancedDataGrid() { super(); } override protected function drawRowBackground( s:Sprite,rowIndex:int,y:Number,height:Number,color:uint,dataIndex:int):void { var item:Object; if(dataIndex <dataProvider.length) { item = dataProvider[dataIndex]; if(item.error_msg != null && item.error_msg != ''){ color = 0xffcccc; }else if(item.less_count>0){ color = 0xffe3e3; }else if(item.error_count>0){ color = 0xffe3e3; }else if(item.more_count>0){ color = 0xffe3e3; }else if(item.redundant_count>0){ color = 0xf4ed73; }else if(item.barbarism_count>0){ color = 0xf4ed73; } } super.drawRowBackground(s,rowIndex,y,height,color,dataIndex); } } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |