|
|
|
I might be misunderstanding the issue, but it seems to be behaving properly. A PrintDataGrid's sizeToPage property defaults to true, meaning it will only show the number of rows that can be displayed and still have the PrintDataGrid fit in its container (in this case, a ViewStack). I made the ViewStack's backgroundColor white, and as I played with the sliders, saw that the number of rows in the PrintDataGrids changed so that each PrintDataGrid could be displayed in the ViewStack. To view the next page of data, call the PrintDataGrid's nextPage() method. Or, if you don't want this functionality of showing few enough rows to stay within its container, set sizeToPage to false.
Please let me know whether I'm misunderstanding the issue or this clears things up. Thanks! Problem still exists...
I uploaded new versions of the files. I removed the ViewStack, using only the VBox. The Test1 problem from the main report appears to be fixed in the original by setting the resizeToContent="true" for the ViewStack. The Test2 problem still appears - it looks like a sizing negotiation problem with VBox and (perhaps) the dynamic content - or variable width rows of PrintDataGrid. If you run it, with 4 grids, 4 rows - the last rows are cut off of the later grids. If you forcefully set the VBox height=800, they all display correctly. This provides a workaround of manually computing the needed height for the VBox. The cause seems to be a side effect of measuring the height of the PrintDataGrid - it sets the _originalHeight from NaN to an actual value. The code is also using the fact that _originalHeight is NaN to decide whether to send a value or -1 to the measuring methods.
It's hard to understand what the _originalHeight variable is supposed to be doing. The following is obviously not the right fix, but it does correct the problem for the given case. override protected function measure():void { var oldRowCount:uint = rowCount; var count:uint = (dataProvider) ? dataProvider.length : 0; if (count >= verticalScrollPosition) count -= verticalScrollPosition; else count = 0; if (headerVisible) count++; setRowCount(count); // need to calculate rowCount before super() super.measure(); measureHeight(); /*if (isNaN(_originalHeight)) _originalHeight = measuredHeight; ********************************************************/ _currentPageHeight = measuredHeight; if (!sizeToPage) { setRowCount(oldRowCount); super.measure(); } } override public function setActualSize(w:Number, h:Number):void { if (!isNaN(percentHeight)) { // _originalHeight = h; ************************************************************************ super.percentHeight = NaN; measure(); h = measuredHeight; } super.setActualSize(w, h); invalidateDisplayList(); if (sizeToPage && !isNaN(explicitHeight)) explicitHeight = NaN; } This is unchanged, but is called twice for each print grid, the second time _originalHeight has been set to a value other than NaN.... private function measureHeight():void { if (dataProvider && dataProvider.length > 0 && (verticalScrollPosition >= dataProvider.length)) { setRowCount(0); measuredHeight = 0; measuredMinHeight = 0; return; } var o:EdgeMetrics = viewMetrics; var rc:int = (explicitRowCount < 1) ? rowCount : explicitRowCount; //*********************************************************************** var maxHeight:Number = isNaN(_originalHeight) ? -1 : _originalHeight - o.top - o.bottom; measuredHeight = measureHeightOfItemsUptoMaxHeight( -1, rc, maxHeight) + o.top + o.bottom; measuredMinHeight = measureHeightOfItemsUptoMaxHeight( -1, Math.min(rc, 2), maxHeight) + o.top + o.bottom; } Alex says it's a bug. Able to reproduce in 2.0.1 and 3.0.
Consider the PrintDataGrid family of bugs for 3.0.x.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
https://bugs.adobe.com/jira/browse/SDK-14174
but exhibiting other anomalies, too.