Hi..
Use the *Lable Function* & *dataField* for the DataGrid..
Which is used to format the DataGrid column datas..:)


2009/11/23 Brolesi, Fogliarini <[email protected]>

> Hello all.
>
> I've a problem with a DataGrid Component, using an ItemRenderer. I get the
> data from a MySQL database, that returns the date in the format YYYY-MM-DD.
> In the flex interface, I'm using an ItemRenderer, the code is here:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml";
> creationComplete="init()">
>     <mx:Script>
>         <![CDATA[
>             import mx.controls.DateField;
>
>             [Bindable] public var datetime:String = '';
>
>             public function init():void
>             {
>                 if(datetime != '0000-00-00')
>                 {
>                     this.text =
> DateField.dateToString(DateField.stringToDate(datetime, 'YYYY-MM-DD'),
> 'DD/MM/YYYY');
>                 }
>                 else
>                 {
>                     this.text = 'Not defined';
>                 }
>             }
>         ]]>
>     </mx:Script>
> </mx:Label>
>
> The problem is when i populate the DataGrid with a dataProvider and after I
> remove/add rows. What occurs is that the ItemRenderer doesn't recognize the
> new data, and shows the old date.
>
> Someone had the same problem? Wha't I can do?
>
> Thanks and sorry about my poor English (I'm brazilian).
>
> --
>
> Fabio Fogliarini Brolesi
> http://fabio.freesandbox.net/
>
> "Se eu tenho uma maçã e você tem uma maçã, e nós as trocarmos, cada um
> continua com uma maçã. Se eu tenho uma idéia e você tem uma idéia, e nós as
> trocarmos, cada um fica com duas idéias."
> George Bernard Shaw - Dramatrugo Irlandês
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<flex_india%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=.
>



-- 
With Regards,
Nizar.
Catch me @ 9790503327
Mail: [email protected]

--

You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=.


Reply via email to