国产探花免费观看_亚洲丰满少妇自慰呻吟_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>

(編輯:武林網)

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 门头沟区| 林甸县| 米易县| 开原市| 桐城市| 治多县| 新干县| 芷江| 株洲市| 航空| 汉沽区| 舟山市| 芜湖县| 简阳市| 江川县| 景洪市| 五指山市| 信宜市| 常山县| 南木林县| 邓州市| 通辽市| 宜阳县| 长治市| 河源市| 都匀市| 承德县| 玉环县| 奈曼旗| 屯门区| 杂多县| 罗平县| 大名县| 沂源县| 呼玛县| 腾冲县| 晴隆县| 家居| 宜君县| 揭阳市| 舒城县|