I have the Latest Build, i tried it and it works great, Thanks. Just had to
call it on collection change as well.
override protected function measure():void{
super.measure();
var totalHeight:Number = 0;
if (dataProvider && autosize && variableRowHeight&& dataProvider.length
>0){
for (var row:int = 0;row<dataProvider.length;row++){
var maxHeight:Number = 0;
for (var col:int = 0;col<columns.length; col++){
var column:GridColumn = columns.getItemAt(col) as GridColumn;
if (column.visible){
var renderer:IGridItemRenderer = grid.getItemRendererAt(row,col);
if (renderer && renderer.height>maxHeight){
maxHeight = renderer.height;
}
}
}
totalHeight +=maxHeight + 7;
}
if(totalHeight!=gridMaxHeight){
gridMaxHeight = totalHeight;
grid.height = totalHeight;
}
}
}
}
On Mon, Jul 6, 2015 at 3:49 PM, Alex Harui <[email protected]> wrote:
>
>
> On 7/6/15, 12:58 AM, "Ronny Shibley" <[email protected]> wrote:
>
> >Hey Alex,
> >
> >Thanks for your prompt reply,
> >
> >Spark DG always use Virtual Layouts... :(
>
> Oh yeah, I keep forgetting that..
>
> >
> >I'm thinking of writing a piece of code to calculate total height after
> >all
> >the itemrenderers have rendered. Any idea at what stage of the DataGrid
> >lifecycle would be best to implement this code. I need it on column resize
> >and set dataprovider. UpdateDisplayList would be my first bet.
> >
>
> IMO, the layout’s measure() is the place to change. What version of Flex
> are you using?
>
> -Alex
>
>
--
Kind Regards,
Ronny Shibley, Eng
Software Architect | Codefish | www.codefish.com
t +961 5 450824 | m +961 70 250650