最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Flex4 DataGrid中如何嵌入RadioButton

 更新時間:2013年12月30日 17:57:48   作者:  
本文為大家介紹下Flex4 DataGrid中嵌入RadioButton的方法,下面有個不錯的示例,感興趣的朋友可以參考下
復(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頁面
復(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ù)、值對象)放在此處 -->
</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>

相關(guān)文章

最新評論

剑阁县| 星子县| 菏泽市| 淳安县| 巫山县| 招远市| 内丘县| 金山区| 松原市| 阜宁县| 普兰店市| 泊头市| 莱阳市| 万荣县| 饶河县| 聂拉木县| 慈溪市| 汉中市| 长宁县| 广安市| 遂昌县| 闵行区| 平泉县| 楚雄市| 林口县| 萨嘎县| 香格里拉县| 阜康市| 寿宁县| 四平市| 永宁县| 通山县| 石嘴山市| 安乡县| 博野县| 治县。| 密云县| 恩平市| 澜沧| 姜堰市| 巴南区|