Hi Donald,
Hope this helps:
// don't use parenthesis, no parameters required
newDGCol.labelFunction = showUserScheduleType;
private function showUserScheduleType(item:Object,
column:DataGridColumn):String
{
// all of the fields in the data object (row of dataProvider fields)
are available in the item object
return item.userSchedule + " - " + item.scheduleType;
}
-TH
--- In [email protected], "Sefi Ninio" <[EMAIL PROTECTED]> wrote:
>
> This might be what you are looking for:
>
http://www.returnundefined.com/2006/07/datagrid-labelfunction-and-namesp\
aces
>
> HTH
> Sefi
>
> On Sat, Aug 16, 2008 at 10:15 PM, donvoltz [EMAIL PROTECTED] wrote:
>
> > Hello,
> >
> > can someone provide an example of calling a datagrid labelFunction
> > from actionscript.
> >
> > I am currently creating a dynamic datagrid using actionscipt that
> > loops through the days of a month and I have added the labelFunction
> > as below. I am not sure what parameters I need to pass to the
> > labelFunction. I have set an arrayCollection as the datagrid's
> > dataProvider.
> >
> > for (var i:int=0; i< numDays; i++){
> > var newDGCol:DataGridColumn = new DataGridColumn();
> > newDGCol.headerText = String(i+1);
> > newDGCol.width = 25;
> > newDGCol.sortable = false;
> > newDGCol.dataField = "userSchedule";
> > newDGCol.labelFunction = showUserScheduleType(); //What parameter
> > do I pass to the labelFunction
> > cols.push(newDGCol);
> > }
> >
> > //Label Function I am using to test this
> >
> > private function showUserScheduleType(item:Object):void {
> >
> > trace('xml user schedule data ' + ObjectUtil.toString(item));
> > }
> >
> > Thanks for any help or direction on using actionscript to call a
> > labelFunction.
> >
> > Don
> > }
> >
> >
> >
>