First of all, sorry for my late response. Alex, you are my hero! This solves 
the issue a "little bit". But to be honest, not completely.

Ok for documentation:

Now, in my MXAdvancedDataGridItemRenderer I use:

override public function set explicitWidth(value:Number):void
{
        super.explicitWidth = value;
                
        this.label.width = value;
}

With this function the height of the calculated ItemRenderer for printing is 
correct. I think we have to update / change code the Default ItemRenderer which 
are used for PrintDataGrid and PrintAdvancedDataGrid that the height is 
calculated correct when someone is using only the Default ItemRenderer and 
wordWrap="true" variableRowHeight="true" for the Print(Advanced)DataGrid. I 
will test this, when my print works.

But there is still a print issue when I use colspan for some columns. I am 
currently investigating this issue.

It seems that the every time the width and height of the columns (<mx:columns>) 
will be calculated in the   AdvancedDataGridBaseEx 
measureHeightOfItemsUptoMaxHeight function, but rendererProviders for colspan 
are not considered during this calculation. But I think during this calculation 
we should look if there will be used maybe another ItemRenderer for colspan. So 
if the Colspan-ItemRenderer is used, the Width and Height is of course not the 
same as the height and width of the column-ItemRenderer. (I hope every body 
understand what I mean. ;-) )

It's funny that I found this in the AdvancedDataGridBase.as Line 1600:

    /**
     *  @private
     *  This grid just returns the column size,
     *  but could handle column spanning.
     */
    mx_internal function getWidthOfItem(item:IListItemRenderer,
                                        col:AdvancedDataGridColumn, 
visibleColumnIndex:int):Number
    {
        return col.width;
    }

Yea, I think this would definitively very helpful if this could handle column 
spanning. ;-)

And a small issue when I print, the "pagebreak" of the PrintAdvacedDataGrid is 
1 row "too early". When I look at my next page, the first row would perfectly 
fit on the previous page. Ok, currently this doesn't bother me too much, but 
this maybe can also be fixed.

Any help appreciated. Thanks

Marcus

Am 14.03.2014 um 20:42 schrieb Alex Harui <aha...@adobe.com>:

> It looks to me that the Label's width is not tied to the explicitWidth of the 
> renderer at measure time, only at layout time.
> 
> You can try binding label's width to "{explicitWidth - 14}".  If you think 
> the binding is too slow, then override the explicitWidth setter and set the 
> Label's width then.
> 
> HTH,
> -Alex

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to