Glad things are getting better.

If the default renderer is just a textfield, then it should handle wordWrap and 
variableRowHeight correctly.  It is more complex renderers with children that 
often need the child tied to the explicitWidth.

I'm not surprised that column spanning has bugs in this kind of scenario.  Try 
overriding that mx_internal method and see if you can come up with a better 
calculation.

Often, the last row is just one or two pixels too tall.  TextFields usually 
have a couple of blank rows of pixels below the glyphs so while it looks like 
it will fit, the math says it doesn't.

-Alex

From: Marcus Fritze 
<marcus.fri...@googlemail.com<mailto:marcus.fri...@googlemail.com>>
Reply-To: "dev@flex.apache.org<mailto:dev@flex.apache.org>" 
<dev@flex.apache.org<mailto:dev@flex.apache.org>>
Date: Tuesday, March 18, 2014 6:47 AM
To: "dev@flex.apache.org<mailto:dev@flex.apache.org>" 
<dev@flex.apache.org<mailto:dev@flex.apache.org>>
Subject: Re: print issues FLEX-23252 and FLEX-13628 was [REQUEST] tutorial....

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<mailto: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

Reply via email to