Hi Zied,

You don't need any object of type function but you need a function
which returns a string.

Just assign the name of that string returning function to the
labelFunction property of datagridColumn. Like this:

dgc.labelFunction = myFunction;

Hope this helps.

-Ravi

On Mar 17, 6:19 pm, zied Majdoub <zied.e...@gmail.com> wrote:
> Hi Ravi,
> I have created some label functions, and I want to create on runtime
> my dataGrid. I want to set the labelFunction of a dataGrid column by
> getting the name of the function as a string from an xml.
> example:
> var dgc:DataGridColumn = new DataGridColumn();
> dgc.dataField = "myField";
> dgc.editorDataField = "fieldName";
> dgc.labelFunction = ??? // I have The name of the function:
> "myFunction" but I need an object of type Function, the function
> definition is already written.
>
> I hope I was clearer :)
> Thanks
>
> On 17 mar, 13:33, Ravi Mishra <ravi.achi...@gmail.com> wrote:
>
> > Hi Zied,
>
> > I could not get what you want to achieve. Can you be a little more
> > clearer?
>
> > -Ravi
>
> > On Mar 17, 4:10 pm, zied Majdoub <zied.e...@gmail.com> wrote:
>
> > > Hi,
> > > I want set a Function attribute using AS, but I only have the function
> > > name as a string.
> > > For example I want to put labelFunction to DataGridColumn object.
> > > public function set labelFunction(value:Function):void
> > >     {
> > >         _labelFunction = value;
>
> > >         if (owner)
> > >         {
> > >             owner.invalidateList();
> > >         }
>
> > >         dispatchEvent(new Event("labelFunctionChanged"));
> > >     }
>
> > > So I need to put a value of type Function in the labelFunction
> > > attribute. Anyone knows how to do that?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_india@googlegroups.com
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to