PDA

View Full Version : auto expanding datagrid


saltzmanjoelh
11-21-2008, 03:38 PM
Is it possible to have the datagrid auto expand like with HTML tables?

EndlessLine
11-21-2008, 04:15 PM
I'm not exactly sure of the event dispatcher but you could do something like this I think...

var dg:DataGrid = new DataGrid;
dg.dataProvider = someDataProvider;
var pan:Panel = new Panel; //this is whatever the dg is attached to
pan.addChild(dg);
pan.addEventListener(ResizeEvent.RESIZE,resizeHand ler);

private function resizeHandler(e:Event):void
{
e.target.dg.percentWidth = 100; //This might be way wrong.... you could also set the dg to a public var and do it this way
this.dg.percentWidth = 100; //Also shooting from the hip, if anyone else knows a better solution we are both in need :)
}