Flex DataGrid 偽合并單元格思路及代碼
更新時(shí)間:2014年05月13日 11:31:42 作者:
這篇文章主要介紹了Flex DataGrid 偽合并單元格思路及代碼,需要的朋友可以參考下
復(fù)制代碼 代碼如下:
<?xml version="1.0" encoding="utf-8"?>
<s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%" height="100%"
autoDrawBackground="false"
creationComplete="mxitemrenderer1_creationCompleteHandler(event)"
>
<s:layout>
<s:VerticalLayout verticalAlign="middle" horizontalAlign="center"/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Text;
import mx.events.FlexEvent;
protected function mxitemrenderer1_creationCompleteHandler(event:FlexEvent):void
{
var txt1:String = lbl.text.split(",")[0];
var txt2:String = lbl.text.split(",")[1];
lbl1.text = txt1;
lbl2.text = txt2;
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 將非可視元素(例如服務(wù)、值對(duì)象)放在此處 -->
</fx:Declarations>
<s:Label id="lbl" text="{dataGridListData.label}" visible="false" height="0"/>
<s:VGroup id="vp" width="100%" height="100%" gap="2" >
<s:Label id="lbl1" color="0x000000" textAlign="center" verticalAlign="middle" width="100%"/>
<mx:HRule width="100%" chromeColor="0x999999" alpha="0.3"/>
<s:Label id="lbl2" color="0x000000" textAlign="center" verticalAlign="middle" width="100%"/>
</s:VGroup>
</s:MXDataGridItemRenderer>
相關(guān)文章
flex利用webservice上傳照片實(shí)現(xiàn)代碼
這篇文章主要介紹了flex利用webservice上傳照片實(shí)現(xiàn)代碼,需要的朋友可以參考下2014-05-05
flex導(dǎo)出excel具體實(shí)現(xiàn)
flex導(dǎo)出excel的前提是需要插件as3xls-1.0.1.swc,下面為大家介紹下具體的實(shí)現(xiàn)2014-01-01
Flex動(dòng)態(tài)生成可編輯的DataGrid具體實(shí)現(xiàn)代碼
DataGrid具有以下功能:表頭是動(dòng)態(tài)生成的、每行都是有序號(hào)的、每行都是可以編輯、插入、刪除、修改,接下來為大家分享下Flex如何動(dòng)態(tài)生成可編輯的DataGrid2013-04-04
Flex中的HDividedBox和VDividedBox的比較附圖
學(xué)習(xí)Flex的朋友對(duì)HDividedBox和VDividedBox并不陌生吧,下面是兩者的簡(jiǎn)單比較,感興趣的朋友可以參考下2013-10-10
FLEX ArrayCollection刪除過濾的數(shù)據(jù)問題解決
ArrayCollection添加過濾器后,調(diào)用removeItemAt()是無法刪除的,下面有個(gè)不錯(cuò)的解決方法,大家可以參考下2014-06-06

