开发者

Flex: Make advanced data grid height of rows?

I have an ADG along with some other components in a VBox. The number of rows of items in the ADG is variable. I want the height of the ADG to be however tall it needs to be to show all the rows without scrolling. This is because I want the containing VBox to handle all the scrolling.

The reason being, is because sometimes there is a horizontal scroll bar on the VBox, in this case you have to scroll all the way to the right to reveal the scro开发者_开发技巧ll bar for the ADG before you can scroll the ADG.

So is there a way to do this?

Thanks.


You could bind the ADG's "rowCount" property to the length of the data provider:

rowCount="{ dataProvider.length }"

If that doesn't handle the rested rows property, then you could write a function that calculates the total number of rows:

rowCount="{ getRowCount( dataProvider ) }"

private function getRowCount( dataProvider:ArrayCollection ):int
{
    // walk through dataProvider and count up rows + nestedRows
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜