Flex DataGrid 伪合并单元格思路及代码
来源:本站原创|时间:2022-11-25|栏目:Flex|
复制代码 代码如下:
<?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>
您可能感兴趣的文章
- 01-11flex调用webservice中的自定义类的方法
- 01-11datagrid不可编辑行有关问题的控制方法
- 01-11Flex实现的上传摄像头拍照并将UI保存为图片
- 01-11Flex字体加粗问题只能对英文的字体加粗
- 01-11flex利用webservice上传照片实现代码
- 01-11Flex控制弹出窗口拖动范围示例代码
- 01-11flex内嵌html网页示例代码
- 01-11Flex中在Tree绑定数据后自动展开树节点的方法
- 01-11Flex弹出窗口请求Action函数示例
- 01-11Flex中通过RadioButton进行切换示例代码