4,328
社区成员
发帖
与我相关
我的任务
分享
<mx:Module initialize="init()" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" width="100%" height="100%">
<mx:DataGrid headerHeight="24" rowHeight="28" dataProvider="{roles}" width="100%" verticalAlign="middle" height="100%" headerStyleName="trHead">
<mx:columns>
<mx:DataGridColumn width="180" dataField="name" headerText="角色代码" />
<mx:DataGridColumn width="80" dataField="roleType" headerText="角色类别" labelFunction="disRoleType" />
</mx:columns>
</mx:DataGrid>
</mx:Module>
<mx:RemoteObject
id="krSysRoleService"
destination="flexKrSysRoleService"
result="getRole(event)"
showBusyCursor="true"/>
private function init():void{
krSysRoleService.query();
}
private function getRole(event:ResultEvent):void{
roles = ArrayCollection(event.result);
}
public class FlexKrSysUserService{
private var bresult:Boolean;
public function checkLoginname(loginName: String):void{
var ro: RemoteObject = new RemoteObject();
ro.destination = _destination;
ro.checkLoginname(loginName);
ro.addEventListener(ResultEvent.RESULT, checkLoginnameResult);
}
public function checkLoginnameResult(evt: ResultEvent):Boolean{
bresult = evt.result as Boolean;
return bresult;
}
public function getBresult(): Boolean{
return bresult;
}
}
public function checkLoginname(loginName: String):Boolean{
var ro: RemoteObject = new RemoteObject();
ro.destination = _destination;
var result = ro.checkLoginname(loginName); ro.addEventListener(ResultEvent.RESULT, checkLoginnameResult);
return result;
}