This works, but my code in my main app doesn't work... imagine that....
alskdjflajdlksfjl kasfdlaksj dfliasjdlifj o asdlfj

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
initialize="initApp();">
<mx:Script>
<![CDATA[

function initApp()
{
 datagrid1.labelFunction = test;
 datagrid1.dataProvider = [{col1: "sup", col2: "g money"}];
}

function test(item, colName)
{
 return "cow";
}

]]>
</mx:Script>
  <mx:DataGrid id="datagrid1">
    <mx:columns>
      <mx:Array>
        <mx:DataGridColumn headerText="Column 1" columnName="col1" />
        <mx:DataGridColumn headerText="Column 2" columnName="col2" />
      </mx:Array>
    </mx:columns>
  </mx:DataGrid>
</mx:Application>
----- Original Message ----- 
From: "JesterXL" <[EMAIL PROTECTED]>
To: "Flexcoders" <[email protected]>
Sent: Tuesday, May 17, 2005 4:19 PM
Subject: [flexcoders] DataGrid.labelFunction


I cannot get this to work.

I've tried:

my_datagrid.labelFunction = Delegate.create(this, onMyLabelFunction);
my_datagrid.labelFunction = onMyLabelFunction;

As well as through the attribute in the datagrid tag:

<mx:DataGrid labelFunction="onMyLabelFunction"

I can trace out that it's actually setting the value to a valid function
through the debugger and me tracing out the values to a TextArea, but that
same debugging session shows the actual function itself never getting run.

I've tried setting the dataProviders right after, 1 frame after, and even 2
frames after via multiple doLaters.

I've tried setting the ViewStack hosting this component to to auto
creationLayout instead of all, and used childrenCreated to defer the actual
setup.

Nothing works.

:: whips out gak and unloads a few rounds into monitor ::

--JesterXL




Yahoo! Groups Links







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to