--- In [email protected], "markgoldin_2000"
<[EMAIL PROTECTED]> wrote:
>
> Is it possible to create a composite custom item renderer for a tree
> component?
>
> Thanks
>
Use a static array in the item renderer. Keep information
in the item renderer only, isolated from other components.
// declare static array
private static var expandedItems:Array = new Array();
// Setter function of item renderer where we set the data object
// Set the size quickly and directly.
if(expandedItems.indexOf(data)>-1){
// show item in expanded state without any effect
} else {
// show item in contract size
}
// Expand and collapse the item renderer on double click
// play the expand or contract effect and remember
// the size in a static array:
private function setRowSize():void{
var arrayPosition:int = expandedItems.indexOf(data);
if( arrayPosition>-1 ){
contract.end();
contract.play();
expandedItems.splice(arrayPosition,1);
} else {
expand.end();
expand.play();
expandedItems.push( data );
}
}
The above should provide the basis and there is another interesting
elaboration, with mxml source available on flexcomguru which should
get you started.
http://www.flashcomguru.com/apps/flex/expandinglist/ExpandingList.html