DataGrid删除数据后如何自动更新

mainl.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init();">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
[Bindable]
private function init():void{
flash.system.System.useCodePage=true;
getBeauty();
}
private function getBeauty():void{
hsGetBeauty.send();
}
public function delBeauty():void{
var delId:Object = new Object;
delId.id = dgBeauty.selectedItem.id;
hsDelBeauty.send(delId);
}
private function delResult(event:ResultEvent):void{
Alert.show( "Result "+String(event.result) );
getBeauty();
}
]]>
</mx:Script>
<mx:Style source="beauty.css"/>
<mx:HTTPService id="hsGetBeauty" url="http://localhost/beauty/php/getbeauty.php"/>
<mx:HTTPService id="hsDelBeauty" url="http://localhost/beauty/php/delbeauty.php" method="GET" result="delResult(event)"/>
<mxataGrid styleName="dgBeauty" id="dgBeauty" x="48" y="29" width="646" height="207" dataProvider="{hsGetBeauty.lastResult.beauties.beauty}">
<mx:columns>
<mxataGridColumn headerText="ID" dataField="id"/>
<mxataGridColumn headerText="姓名" dataField="name"/>
<mx:DataGridColumn headerText="年龄" dataField="age"/>
<mx:DataGridColumn headerText="婚否" dataField="marry"/>
<mx:DataGridColumn headerText="出生日期" dataField="birth"/>
<mx:DataGridColumn headerText="删除" width="60">
<mx:itemRenderer>
<mx:Component>
<mx:Button label="删除" click="outerDocument.delBeauty()"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Application>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值