如何使 Spark DataGrid 水平增长以完全渲染所有列?
我设置了一个 DataGrid,通过将其绑定到控件的高度来显示数据提供程序中的所有行。 现在所有行都已呈现,我希望 DataGrid 水平增长,以便每一列呈现整个文本(标签)。 有没有一种方法可以在不诉诸典型对象的情况下做到这一点?
谢谢, 担
I've set a DataGrid to display all the rows in the data provider by binding it to the height of the control.
Now that all rows are rendered, I want the DataGrid to grow horizontally so that every column renders the whole text (of Labels).
Is there a way of doing this without resorting to a typical object?
thanks,
Dan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 DataGrid 组件的 asdoc :
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/controls/DataGrid.html
当您创建 DataGrid 时,您还可以设置其大小。您可以做什么,但是,循环遍历某一列的所有标签,获取最大值,然后重新设置列 minColumnWidth :
http://help.adobe.com /en_US/FlashPlatform/reference/actionscript/3/fl/controls/DataGrid.html#minColumnWidth
然后,您将相应地调整 DataGrid 的大小,并调用 invalidate() 来重绘组件。
Have a look at the asdoc for the DataGrid component :
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/controls/DataGrid.html
When you create a DataGrid, you also set its size.What you can do, however, is cycle through all the labels for a certain column, get the max value, and re-set the column minColumnWidth :
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/controls/DataGrid.html#minColumnWidth
Then, you would resize the DataGrid accordingly, and call invalidate() to redraw the component.