Hi there,

that will be my first post to a group.

I have a problem with Custom CellRenderer. My aim is a CellRenderer 
on a DataGrid laying out a Grid container and its childs. I�m 
currently learning Flex. I expect the solution will be very easy.

Thats the shortened stuff I�m stucked in:

- - - - - - - -

import mx.core.UIComponent;
import mx.controls.Text;

class lib.CatchwordCellRenderer
extends UIComponent {

var listOwner : MovieClip;
var getCellIndex : Function;
var getDataLabel : Function;

var m_text : MovieClip;
        
function CatchwordCellRenderer() {
}

public function createChildren(Void) : Void {
this.m_text = createClassObject(lib.CRTest, "CRTest", 
0 );
}

public function setValue(str:String, item:Object, 
sel:Boolean) : Void {
}

private function size(Void) : Void {
this.m_text._x = 0;
this.m_text._y = 0;
}
        
public function getPreferredWidth(Void) : Number {
return __width;
}

        
public function getPreferredHeight(Void) : Number {
return __height;
}
}

-> The CRTest.mxml (I tried it in ActionScript before, too.)

<?xml version="1.0" encoding="utf-8"?>
<mx:Grid xmlns:mx="http://www.macromedia.com/2003/mxml"; widthFlex="1" 
heightFlex="1">
<mx:GridRow>
<mx:GridItem>
<mx:Label text="test" />
</mx:GridItem>
</mx:GridRow>
</mx:Grid>

- - - - - - - -

The Component created in createChildren() method is available and 
contains their childs. But nothing (Label) is displayed in the 
DataGrid.

Thank you, for your help.
Robert Gacki

PS: Sorry about my English ;)



Reply via email to