I have an application that retrieves data via a remoteobject call to a
CFC and then populates a datagrid.
I need to use an itemRenderer on the datagridcolumn but the data isnt
there yet when the datagrid initializes..
So how do I make the datagrid wait?
in the index.mxml file I call the even that populates the
arraycollection, I also include the view that is the datagrid..
<!-- happens on creationComplete -->
public function initMe():void {
var evt:CairngormEvent = new CairngormEvent( MyControl.EVENT_LOAD_DATA
);
CairngormEventDispatcher.getInstance().dispatchEvent(evt);
}
then further down in the index.mxml
<view:mainPage width="100%" height="70%" title="Foo App" />
in the mainPage view I have my datagrid
Here's my DG call:
<mx:DataGrid id="dg" width="100%"
height="100%" dataProvider="{MyModel.getInstance().fooAC}"
click="clickHandler(event);"
dataTipFunction="buildToolTip">
<mx:columns>
....
<mx:DataGridColumn dataField="amount"
headerText="Amount:"
textAlign="right"
headerStyleName="centered"
itemRenderer="com.renderers.PriceLabel" />
</mx:columns>
</mx:DataGrid>
The data loads fine in the DataGrid but my custom itemRenderer which looks like
package com.renderers {
import mx.controls.Label;
import mx.controls.listClasses.*;
import mx.controls.Alert;
public class PriceLabel extends Label {
override protected function
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
//super.updateDisplayList(unscaledWidth, unscaledHeight);
//Alert.show(data.toString());
}
}
}
doesnt work.. it returns a null error when referencing data.*anything*..
Any ideas would be great I'm racking my brain on this and it's getting
the best of me!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5501
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37