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

首頁 > 開發 > Flex > 正文

Flex4 DataGrid中如何嵌入RadioButton

2024-09-08 18:16:59
字體:
來源:轉載
供稿:網友


<s:DataGrid fontFamily="微軟雅黑"
horizontalScrollPolicy="off" borderVisible="false"
dataProvider="{viewList}">
<s:columns>
<s:ArrayList>
<s:GridColumn resizable="false"
itemRenderer="Module_SchoolView.RadioButtonGridItemRenderer"/>


<s:GridColumn headerText="名稱" dataField="xysj02" resizable="false"/>

<s:GridColumn headerText="地名" dataField="xysj02name" resizable="false"/>

<s:GridColumn headerText="URL" dataField="xysj04" resizable="false"/>

<s:GridColumn headerText="備注" dataField="xysj05" resizable="false"/>
</s:ArrayList>
</s:columns>
</s:DataGrid>


MXML頁面

復制代碼 代碼如下:


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

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

</s:GridItemRenderer>

(編輯:武林網)

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 鹤壁市| 和龙市| 宜兰县| 永寿县| 贵州省| 上杭县| 济源市| 泰顺县| 府谷县| 祁门县| 和平县| 河北区| 周口市| 贵南县| 镇巴县| 塘沽区| 新乡市| 台南市| 余庆县| 开封县| 陈巴尔虎旗| 武陟县| 武夷山市| 衡水市| 平安县| 荆门市| 班玛县| 东港市| 靖安县| 岳阳市| 元朗区| 治多县| 镇巴县| 华容县| 凤翔县| 永善县| 延津县| 剑阁县| 汾阳市| 芒康县| 夹江县|