请教:flex中Datagrid中嵌入linkbutton,修改linkbutton的label无法响应
Flex中表格datagrid中的‘操作’列中嵌入了linkbutton,希望能够单击该linkbutton后,使得label变为“取消关联”:
<s:GridColumn headerText="操作" rendererIsEditable="true" editable="false" width="80"> <s:itemRenderer> <fx:Component> <s:GridItemRenderer> <mx:LinkButton id="connect" label="关联" textDecoration="underline" color="0x0050AA" horizontalCenter="0" verticalCenter="0" click="outerDocument.connect_clickHandler(this, data as Object)" /> </s:GridItemRenderer> </fx:Component> </s:itemRenderer> </s:GridColumn>
public function connect_clickHandler(obj:Object, item:Object):void { obj.connect.label = (obj.connect.label == "取消关联")?'关联':'取消关联'; }