//删除
protected function btnDelete_click(event:MouseEvent):void
{
// TODO Auto-generated method stub
dgindex=dgScenic.selectedIndex;
if(dgindex==-1) return;
FlexUtility.Msg_YesNo("你是否要删除该条记录?",DeleteScenicType);
}
//删除选中景点类型记录
private function DeleteScenicType():void
{
var qname:QName=new QName("http://tempuri.org/", null);
var soaphearder:SOAPHeader=new SOAPHeader(qname, null);
ws.clearHeaders();
var obj:Object= dataArray.getItemAt(dgindex);
ws.addHeader(soaphearder);
ws.DeleteScenicType(obj.ScenicTypeId,obj.ScenicTypeName);
}
类文件:FlexUtility.as
//函数作为参数传递,再执行。
{
var bReturn:Boolean=false;
Alert.yesLabel="确定";
Alert.noLabel="取消";
Alert.show(strInfo,"温馨提示:",Alert.YES|Alert.NO|Alert.NONMODAL,null,
function(event:CloseEvent):void
{
if(event.detail==Alert.YES)
{
//执行函数
DelScenicTypeFun();
}
else if(event.detail==Alert.NO)
{ }
return;
},null,Alert.NO);
}