datagrid 的行高能根据内容多少自动调整吗

syeia 2010-01-08 10:31:26
datagrid 的行高能根据内容多少自动调整吗 ? 应该如何设置
...全文
444 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
水中影子 2010-01-09
  • 打赏
  • 举报
回复
帮顶!!!!
herowach 2010-01-08
  • 打赏
  • 举报
回复
没看太懂,不固定行高一般设个variableRowHeight="true"就可以了
syeia 2010-01-08
  • 打赏
  • 举报
回复
没有人知道吗

Flex 3.2 怎么办?

syeia 2010-01-08
  • 打赏
  • 举报
回复
里面有渲染器没有问题,而且能让iE 自动出现滚动条
SunFulong 2010-01-08
  • 打赏
  • 举报
回复
Flex 3.2之后默认就是,之前我没测试过
syeia 2010-01-08
  • 打赏
  • 举报
回复
楼上的:

开始我也是这样的,不行, 加的 height="80" , 贴上去忘了删除了。

dg.height = dg.measureHeightOfItems(0, 行数) + dg.headerHeigh;

这样就可以了。 等于二次加载一次。


herowach 2010-01-08
  • 打赏
  • 举报
回复
<mx:Component>
<mx:Text text="{data.name}" />
</mx:Component>
syeia 2010-01-08
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var ac:ArrayCollection=new ArrayCollection([{name:"Ancient Egypt was an ancient dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddcivilization in eastern North Africa, concentrated along the lower reaches of the Nile River in what is now the modern nation of Egypt. The civilization began around 3150 BC with the political unification of Upper and Lower Egypt under the first pharaoh, and it developed over the next three millennia. Its history occurred in a series of stable periods, known as kingdomsPhil Jones Bass and AAD by Phil Jones are now one brand: Phil Jones Pure Sound. With 40 years experience playing bass and perfecting sound, Phil Jones has crazy-like passion and knowledge yielding ground breaking designs and award-winning sound products... along with some great company.Famous customers. Once-in-a-lifetime accolades.Studios like Abbey Road. Jazz pianists like Bob James. Bassists like Pino Palladino. Legends like Bob Babbitt. Composerbassists like Kyle Eastwood. Magazine covers like Stereophile",phone:"fdsdfdd",email:"aaaaaa"},{name:"Ancient Egypt was an ancient dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddcivilization in eastern North Africa, concentrated along the lower reaches of the Nile River in what is now the modern nation of Egypt. The civilization began around 3150 BC with the political unification of Upper and Lower Egypt under the first pharaoh, and it developed over the next three millennia. Its history occurred in a series of stable periods, known as kingdomsPhil Jones Bass and AAD by Phil Jones are now one brand: Phil Jones Pure Sound. With 40 years experience playing bass and perfecting sound, Phil Jones has crazy-like passion and knowledge yielding ground breaking designs and award-winning sound products... along with some great company.Famous customers. Once-in-a-lifetime accolades.Studios like Abbey Road. Jazz pianists like Bob James. Bassists like Pino Palladino. Legends like Bob Babbitt. Composerbassists like Kyle Eastwood. Magazine covers like Stereophile",phone:"fdsdfdd",email:"aaaaaa"},{name:"Ancient Egypt was an ancient dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddcivilization in eastern North Africa, concentrated along the lower reaches of the Nile River in what is now the modern nation of Egypt. The civilization began around 3150 BC with the political unification of Upper and Lower Egypt under the first pharaoh, and it developed over the next three millennia. Its history occurred in a series of stable periods, known as kingdomsPhil Jones Bass and AAD by Phil Jones are now one brand: Phil Jones Pure Sound. With 40 years ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffexperience playing bass and perfecting sound, Phil Jones has crazy-like passion and knowledge yielding ground breaking designs and award-winning sound products... along with some great company.Famous customers. Once-in-a-lifetime accolades.Studios like Abbey Road. Jazz pianists like Bob James. Bassists like Pino Palladino. Legends like Bob Babbitt. Composerbassists like Kyle Eastwood. Magazine covers like Stereophile",phone:"fdsdfdd",email:"aaaaaa"}]);
]]>
</mx:Script>

<mx:VBox width="100%">
<mx:DataGrid rowCount="4" width="100%" wordWrap="true" verticalScrollPolicy="off" variableRowHeight="true" dataProvider="{ac}">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" width="500" dataField="name">
<mx:itemRenderer>
<mx:Component>
<mx:VBox width="100%" height="100%" >
<mx:Text text="{data.name}" height="80" />
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="Column 2" dataField="phone"/>
<mx:DataGridColumn headerText="Column 3" dataField="email"/>
</mx:columns>
</mx:DataGrid>
</mx:VBox>
</mx:Application>

大体是这样,

要求:
1 IE 自动出现滚动条
2 内容显示完整
3 里面不允许出现滚动条。
各位大虾,帮助调试一下。

非常感谢。
syeia 2010-01-08
  • 打赏
  • 举报
回复
列里面使用itemRenderer ,好像datagrid加载完了,再加载itemRenderer 的控件,所以不会改变列的高度。

估计是这样。

谁有办法?

syeia 2010-01-08
  • 打赏
  • 举报
回复
<mx:DataGridColumn headerText="Column 1" dataField="name">
<mx:itemRenderer>
<fx:Component>
<mx:VBox >
<mx:Text text="{data.name}" width="100%" height="100%" />
</mx:VBox>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>

如果 想上面这样用,即使datagrid 的 variableRowHeight="true" ,也不行.
SunFulong 2010-01-08
  • 打赏
  • 举报
回复
我这里没有出现啊?
Arthur0088 2010-01-08
  • 打赏
  • 举报
回复
自动回出现滚动条
SunFulong 2010-01-08
  • 打赏
  • 举报
回复
3.2不需要设置什么,内容有多高,行就有多高

4,328

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计 Flex
社区管理员
  • Flex
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧