返回首頁
當前位置: 主頁 > 視頻動畫 > Flash教程 >

Flex DataGrid 偽合并單元格代碼

時間:2016-05-26 12:06來源:電腦教程學習網 www.aedwey.tw 編輯:admin

這篇文章主要介紹了Flex DataGrid 偽合并單元格思路及代碼,需要的朋友可以參考下

 

<?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>
<!-- 將非可視元素(例如服務、值對象)放在此處 -->
</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>

 

------分隔線----------------------------
標簽(Tag):DataGrid
------分隔線----------------------------
推薦內容
猜你感興趣
26选5中奖通告