(转)flex中DataGrid中itemRenderer的button的click调用方法问题

原网址:http://www.ylzx8.cn/duomeiti/flex/504893.html

button放在DataGrid的itemRenderer里面,为什么调用方法,提示不存在

XML code

    <mx:DataGrid id="dgSelUser" width="100%" height="50%" dataProvider="{flowPeoples}">
         <mx:columns>
        <mx:DataGridColumn headerText="姓名" dataField="userid" />
        <mx:DataGridColumn headerText="部门" />
        <mx:DataGridColumn headerText="管理">
           <mx:itemRenderer>
             <mx:Component>
            <mx:LinkButton label="选择人员" width="30" click="selUser()" />
             </mx:Component>
           </mx:itemRenderer>
        </mx:DataGridColumn>
         </mx:columns>
    </mx:DataGrid>


为什么我的button调用selUser方法提示不存在,,我写在<mx:DataGrid click="selUser()" ../>怎么就可以呢,,需要怎么写
------解决方案-------------------- Renderer里面访问外部变量要用outerDocument 同时selUser要是public的 <mx:LinkButton label="选择人员" width="30" click="outerDocument.selUser()" />

posted on 2014-12-30 15:00  LotusGu  阅读(344)  评论(0编辑  收藏  举报

导航