婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > Flex 自定義DataGrid實現根據條目某一屬性值改變背景顏色

Flex 自定義DataGrid實現根據條目某一屬性值改變背景顏色

熱門標簽:南昌crm外呼系統如何 廣州ai外呼系統業務 中山外呼系統中間件 地圖標注多家店 什么行業需要電話機器人 車載電話機器人 外呼系統號碼顯示 天津企業外呼系統代理商 無錫電銷外呼系統代理

自定義拓展的DataGrid(as類)代碼如下:

package czgh.components 
{ 
import flash.display.Sprite; 

import mx.controls.DataGrid; 
import mx.core.UIComponent; 

public class OptionalDataGrid extends DataGrid 
{ 
private var _rowColorFunction:Function; 
private var _customed:Boolean; 
private var _customerColor:uint=0; 
public function OptionalDataGrid() 
{ 
super(); 
} 

override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void 
{ 
color=0XFFFFFF; 

if(this._rowColorFunction != null) 
{ 
if (dataIndex  this.dataProvider.length) 
{ 
var item:Object=this.dataProvider.getItemAt(dataIndex);//設定顏色 
color=this._rowColorFunction.call(this, item, color); 
} 
} 



super.drawRowBackground(s, rowIndex, y, height, color, dataIndex); 
} 

override protected function drawHeaderBackground(headerBG:UIComponent):void 
{ 
headerBG.setStyle("borderVisible","false"); 
} 



public function set rowColorFunction(rowColorFunction:Function):void 
{ 
this._rowColorFunction=rowColorFunction; 
} 

public function get rowColorFunction():Function 
{ 
return this._rowColorFunction; 
} 


} 
}

在mxml中實現自定義的datagrid并使用 其rowColorFunction方法

//通過比較每條記錄中dataField為act和stand的大小決定該條記錄的背景顏色 
private function setCustomColor(item:Object, color:uint):uint 
{ 
if (Number(item["act"])Number(item["stand"])) 
{ 
return 0x7bbfea; 
} 

return color; 
}
您可能感興趣的文章:
  • Flex 獲取每月第幾周小例子
  • Flex 遍歷Object鍵和值的示例代碼
  • Flex DataGrid 偽合并單元格實現思路
  • Flex4 DataGrid中嵌入RadioButton實現思路及代碼
  • flex 遍歷Object對象內容的實現代碼
  • 全面了解flex的用途

標簽:欽州 海西 泰州 攀枝花 仙桃 呂梁 佛山 滄州

巨人網絡通訊聲明:本文標題《Flex 自定義DataGrid實現根據條目某一屬性值改變背景顏色》,本文關鍵詞  Flex,自定義,DataGrid,實現,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《Flex 自定義DataGrid實現根據條目某一屬性值改變背景顏色》相關的同類信息!
  • 本頁收集關于Flex 自定義DataGrid實現根據條目某一屬性值改變背景顏色的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 西城区| 富阳市| 兴城市| 东安县| 屏山县| 盐源县| 镇原县| 南华县| 滁州市| 安平县| 年辖:市辖区| 玉树县| 峡江县| 汉阴县| 双江| 嘉荫县| 青浦区| 溧阳市| 贵溪市| 鞍山市| 吴川市| 绥中县| 天镇县| 台北市| 岳普湖县| 泾川县| 桓台县| 育儿| 靖西县| 北安市| 麻栗坡县| 尤溪县| 达日县| 冀州市| 无棣县| 平乐县| 炉霍县| 巫山县| 霞浦县| 卢湾区| 榆林市|