国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開發(fā) > Flex > 正文

Flex4 DataGrid中如何嵌入RadioButton

2024-09-08 18:17:24
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
復(fù)制代碼 代碼如下:

<s:DataGrid id="viewDg" width="100%" height="100%" fontFamily="微軟雅黑"
horizontalScrollPolicy="off" borderVisible="false"
dataProvider="{viewList}">
<s:columns>
<s:ArrayList>
<s:GridColumn width="{wid*0.02}" resizable="false"
itemRenderer="Module_SchoolView.RadioButtonGridItemRenderer"/>


<s:GridColumn width="{wid*0.25}" headerText="名稱" dataField="xysj02" resizable="false"/>

<s:GridColumn width="{wid*0.25}" headerText="地名" dataField="xysj02name" resizable="false"/>

<s:GridColumn width="{wid*0.35}" headerText="URL" dataField="xysj04" resizable="false"/>

<s:GridColumn width="{wid*0.13}" headerText="備注" dataField="xysj05" resizable="false"/>
</s:ArrayList>
</s:columns>
</s:DataGrid>

MXML頁(yè)面
復(fù)制代碼 代碼如下:

<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Declarations>
<!-- 將非可視元素(例如服務(wù)、值對(duì)象)放在此處 -->
</fx:Declarations>
<fx:Script>
<![CDATA[

//----------------------------------------------------------------------------------------------------------

override public function prepare(hasBeenRecycled:Boolean):void
{
super.prepare( hasBeenRecycled );

// We make the radio button mimic the selection status of the whole row.
const selected_items: Vector.<Object> = grid.dataGrid.selectedItems;

if( null == selected_items )
{
radio_button.selected = false;
return;
}

if( -1 != selected_items.indexOf( data ) )
radio_button.selected = true;
else
radio_button.selected = false;
}

//----------------------------------------------------------------------------------------------------------

]]>
</fx:Script>

<!--The radio button is only a visual indicator for whether the row is selected or not.
The "selected" property of the radio_button will be controlled by the "prepare" function.
The radio_button should not be allowed any user interaction. Hence disabling it.-->
<s:RadioButton id="radio_button"
label=""
enabled="false"

horizontalCenter="0" verticalCenter="0" />

</s:GridItemRenderer>
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 财经| 镇平县| 深圳市| 闽清县| 通城县| 格尔木市| 科技| 彰化县| 武乡县| 正宁县| 科技| 香格里拉县| 宝清县| 广东省| 湟源县| 彩票| 葵青区| 凤庆县| 普格县| 加查县| 汝城县| 康马县| 湄潭县| 庆阳市| 康马县| 峨眉山市| 绍兴市| 原平市| 萝北县| 郴州市| 岱山县| 平山县| 都匀市| 新郑市| 德昌县| 红河县| 桦川县| 南汇区| 祁门县| 德安县| 永寿县|