小小菜鸟的web菜园子

web开发学习。好记性不如烂笔头。每天进步一点点!

导航

访问DataGrid中组件的属性.

如何访问DataGrid中控件的属性呢? 这个问题问了好多地方,一直感觉一定有个类似C#中的findControl的方法,终于有了答案~来自AS3天地会。
<mx:DataGrid id="musicList" width="100%" textAlign="center" dataProvider="{myFavorite}" bottom="9" top="0">
                          
<mx:columns>
                                 
<mx:DataGridColumn headerText="操作">
                                        
<mx:itemRenderer>
                                               
<mx:Component>
                                                      
<mx:HBox horizontalAlign="center">
                                                             
<mx:Button id="bt1" styleName="localMusicButton" click="parentDocument.dataGridDownLoadButtonClick(event)"/>
                                                             
<mx:Button id="bt2" styleName="gdplayButton" click="parentDocument.dataGridButtonClick(event)"/>
                                                      
</mx:HBox>
                                               
</mx:Component>
                                        
</mx:itemRenderer>
                                 
</mx:DataGridColumn>                               
                                
<mx:DataGridColumn headerText="歌名" dataField="songName"/>
                                  
</mx:columns>
                   
</mx:DataGrid>

我想访问id为bt1的Button的属性,怎么做呢?

解决方法:

musicList.indexToItemRenderer(musicList.selectedIndex).document.bt1

posted on 2008-05-03 15:17  『小小菜鸟』  阅读(837)  评论(0编辑  收藏  举报