本文介绍了Flex DataGrid列宽:一列来统计它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Flex 4,mx:DataGrid,设置了以下(相关)属性:

I have a Flex 4, mx:DataGrid with the following (pertinent) properties set:

width="100%"
horizontalScrollPolicy="off"

我有 minWidth 在所有 DataGridColumns 上设置,并在其中一个上设置宽度。如果我只是最大化/最小化应用程序的显示(在浏览器或独立的Flash播放器中),这些列可以很好地扩展。但是,如果您抓住应用程序的边缘并拖动它来使其更大,只有一列增长非常大。当您再次拖动尺寸时,一列仍然保持大,但所有其他列都会压缩。

I have the minWidth set on all of the DataGridColumns and the width set on one of them. If I simply maximize/minimize the display (in browser or stand-alone flash player) of the application, the columns scale up and down nicely. But if you grab the edge of the application and drag it to make it bigger, only one column grows really big. When you drag the size down again, the one column remains big, but all of the other columns get squished way down.

这是一个Flex DataGrid中的错误,或者我刚刚丢失一个键属性(或datagrid列上的属性)进行设置,以便在拖放该应用程序时使所有列增长和缩小?

Is this a bug in the Flex DataGrid, or am I just missing a key property (or properties on the datagrid columns) to set, to make all columns grow and shrink when you drag-enlarge the app?

推荐答案

这是一个令人不快的异常,如果不是一个实际的错误,Flex的数据传输方式。在Adobe的防守中,找出如何调整所有列的大小似乎并不是一件简单的任务。

It is an unpleasant anomaly, if not an actual bug, in the way Flex does datagrids. In Adobe's defense, figuring out how to resize all the columns appears not to be a trivial task.

我一直处理的方式是在虚拟列结束,minWidth为4,没有宽度规格。那就成为占用松弛的可扩展列。然后我确保允许其余的列足够的空间来显示他们的数据和他们的头渲染器从一开始给每个一个minWidth和一个宽度。唯一的问题是如果有太多的列显示在允许的空间中,在这种情况下你会得到一个水平的滚动条,所有(或大多数)的赌注是关闭的。

The way I've always handled this is to make a dummy column at the end, with a minWidth of 4 and no width specification. Then that becomes the "expandable column" that takes up the slack. Then I make sure to allow the rest of the columns enough room to display their data and their header renderers from the start by giving each a minWidth and a width. The only time I have problems is if there are too many columns to display in the space allowed, in which case you get a horizontal scrollbar and all (or most) bets are off.

这篇关于Flex DataGrid列宽:一列来统计它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 00:22