Espero que me puedan ayudar porfa
Lo que quiero hacer es una buscar por fecha(todas aquellas personas que estan de cumpleaños), la idea es que lo aga aumaticamente y lo muestre desde el datagrid.
ESto es lo que e conseguido hacer hasta ahora me muestra la fecha actual al inciar el sistema, pero no logro mostrar la fecha en el Form.
Código :
?xml version="1.0" encoding="utf-8"?>
<!--
*@autor ?¿?¿?¿
-->
<mx:Application creationComplete="iniciar()" xmlns:Componente="Componentes.*" xmlns:mx="http://www.adobe.com/2006/mxml" width="992" color="#00D2FF" borderThickness="20" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FF9600, #FFFFFF]" height="756" layout="absolute" borderColor="#F0A078">
<mx:Script>
<![CDATA[
import mx.controls.Menu;
import mx.events.MenuEvent;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;
import mx.managers.PopUpManager;
import mx.managers.*;
import mx.formatters.DateFormatter;
import mx.events.CalendarLayoutChangeEvent;
var menu:Menu;
private function iniciar():void{
var dt:Date = new Date();
var dtf:DateFormatter = new DateFormatter;
thisDate.text = dtf.format(dt);
RO.buscarfechaCumpleaños.send(date.text, month.text);
}
public function iniciarMenu():void{
menu=new Menu;
var o:Object=[{label:"Agregar Cliente"},{label:"Crear Receta"},{label:"Buscar y Ver Detalle"}];
menu.dataProvider=o;
menu.addEventListener("itemClick",elegir);
pop1.popUp=menu;
}
public function elegir(event:MenuEvent):void{
var s:String=event.label;
switch(s){
case "Agregar Cliente":
agreclie.visible=true;
verclie.visible=false;
burclie.visible=false;
break;
case "Crear Receta":
verclie.visible=true;
agreclie.visible=false;
burclie.visible=false;
break;
case "Buscar y Ver Detalle":
verclie.visible=false;
agreclie.visible=false;
burclie.visible=true;
break;
}
}
private function useDate(eventObj:CalendarLayoutChangeEvent):void {
// Make sure selectedDate is not null.
if (eventObj.currentTarget.selectedDate == null) {
return
}
//Access the Date object from the event object.
day.text=eventObj.currentTarget.selectedDate.getDay();
date.text=eventObj.currentTarget.selectedDate.getDate();
month.text=eventObj.currentTarget.selectedDate.getMonth() + 1;
year.text=eventObj.currentTarget.selectedDate.getFullYear();
wholeDate.text= (eventObj.currentTarget.selectedDate.getMonth() + 1) +
"/" + (eventObj.currentTarget.selectedDate.getDate() +
"/" + eventObj.currentTarget.selectedDate.getFullYear());
}
private function dateChooser_init(dt:DateField):void {
dt.dayNames=['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'];
dt.monthNames=[ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
'Julio', 'Agosto', 'Septiembre', 'Octubre',
'Noviembre', 'Diciembre'];
dt.firstDayOfWeek = 1;
dt.formatString = "DD/MM/YYYY";
}
]]>
</mx:Script>
<Componente:agregar id="agreclie" x="275" y="41" visible="false" width="560" height="444"/>
<Componente:verClientes id="verclie" x="54.5" y="41" visible="false" width="883" height="555"/>
<Componente:BuscarCliente id="burclie" visible="false" x="20" y="63" width="929" height="455"/>
<mx:RemoteObject id="RO" destination="dest" fault="Alert.show(event.fault.faultString,'Error')" />
<mx:Panel x="201" y="571" visible="false" width="20" height="21" layout="absolute" title="Empleado" id="p1"/>
<mx:ApplicationControlBar visible="true" id="ACB" x="0" y="0" width="1024" fillAlphas="[1.0, 1.0]" fillColors="[#FF6C00, #FF6C00]" cornerRadius="20">
<mx:Label width="244"/>
<mx:PopUpButton label="Crear Boleta" id="pop1" width="112" creationComplete="iniciarMenu()" color="#000000" fillAlphas="[1.0, 1.0]" fillColors="[#B3B7C6, #A6A5C7]" alpha="1.0"/>
<mx:Label width="60"/>
<mx:Label width="60"/>
</mx:ApplicationControlBar>
<mx:DateField id="thisDate" x="407" y="114" change="useDate(event)" creationComplete="dateChooser_init(thisDate)" yearNavigationEnabled="true" color="#000000"/>
<mx:Form x="131.5" y="114" visible="true">
<mx:FormItem label="Day of week">
<mx:TextInput id="day" width="100"/>
</mx:FormItem>
<mx:FormItem label="Dia">
<mx:TextInput id="date" width="100"/>
</mx:FormItem>
<mx:FormItem label="Mes">
<mx:TextInput id="month" width="100"/>
</mx:FormItem>
<mx:FormItem label="Año">
<mx:TextInput id="year" width="100"/>
</mx:FormItem>
<mx:FormItem label="Date">
<mx:TextInput id="wholeDate" width="100"/>
</mx:FormItem>
</mx:Form>
<mx:DataGrid x="337" y="329" color="#000000" dataProvider="{RO.buscarfechaCumpleaños.lastResult}">
<mx:columns>
<mx:DataGridColumn headerText="Nombres" dataField="nombre"/>
<mx:DataGridColumn headerText="Apellidos" dataField="apellidos"/>
<mx:DataGridColumn headerText="Fecha" dataField="email"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>.espero que me ayuden porfa
