Flex4 DataGrid中如何嵌入RadioButton

本文为大家介绍下Flex4 DataGrid中嵌入RadioButton的方法,下面有个不错的示例,感兴趣的朋友可以参考下

复制代码 代码如下:

horizontalScrollPolicy="off" borderVisible="false"
dataProvider="{viewList}">


itemRenderer="Module_SchoolView.RadioButtonGridItemRenderer"/>













MXML页面
复制代码 代码如下:


xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">





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

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. = 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;
}

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

]]>



label=""
enabled="false"

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


以上就是Flex4 DataGrid中如何嵌入RadioButton的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » Flex