am11pm7: 2007年6月アーカイブ
Flex3 Beata で遂にAdvancedDataGridが追加され、
様々な機能が付与されたようなので早速触ってみる。
AdvancedDataGridColumnGroupクラスがあり、
これでAdvancedDataGridColumnを囲むことでグループ化できる。
かなり深い階層のものを作ってみたがちゃんとできてる。
同じグループ内であればちゃんとドラッグで列順も変えれるのはいい
いままでheaderRenderer等を駆使して苦労してたのが嘘のように簡単だ。
だが、あまり深く造りすぎたのちょっと動作が重い・・・
あと横スクロールバーでスクロールさせようとすると動作がバグってて
うまくスクロールできず下のスクリーンショットのようにぶっこわれるよ。
![]()
以下は試したソース。
クラス名が長いからソースが見にくいよ~。
[code]
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
[Bindable]
private var dp:ArrayCollection = new ArrayCollection();
private function creationCompleteHandler(event:FlexEvent):void {
//適当なデータを作る
var data:ArrayCollection = new ArrayCollection();
var i:int;
var iLimit:int = 100;
for (i = 0; i < iLimit; i++) {
data.addItem(
{
a:"a"+getValue(), b:"b"+getValue(), c:"c"+getValue(), d:"d"+getValue(), e:"e"+getValue(),
f:"f"+getValue(), g:"g"+getValue(), h:"h"+getValue(), i:"i"+getValue(), j:"j"+getValue(),
k:"k"+getValue(), l:"l"+getValue(), m:"m"+getValue(), n:"n"+getValue(), o:"o"+getValue(),
p:"p"+getValue(), q:"q"+getValue(), r:"r"+getValue(), s:"s"+getValue(), t:"t"+getValue(),
u:"u"+getValue()
}
);
}
trace(data);
dp = data;
}
private function getValue():String {
return Math.floor(Math.random()*100).toString();
}
]]>
[/code]
