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

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

Flex4 DataGrid中嵌入RadioButton實現(xiàn)思路及代碼

2024-09-08 18:17:32
字體:
供稿:網(wǎng)友
<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頁面

<?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>
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 洪湖市| 武义县| 沈丘县| 古田县| 绵阳市| 青龙| 黎城县| 盈江县| 调兵山市| 老河口市| 平潭县| 永康市| 双辽市| 靖西县| 明光市| 彭泽县| 衢州市| 鞍山市| 舟山市| 绥化市| 阜宁县| 长治市| 榆中县| 喜德县| 邵阳县| 东乌珠穆沁旗| 平武县| 达尔| 内黄县| 宿松县| 仁布县| 林西县| 滕州市| 泽库县| 黔南| 贡山| 安福县| 温宿县| 雷波县| 普陀区| 建瓯市|