The following example shows the source code for the header renderer class, which is in a file named myRenderer.as. The bold text indicates where the tooltip for the first column header is created in the createChildren() method.
import mx.controls.Label;
class myRenderer extends mx.controls.Label{
var lbl : MovieClip;
var listOwner : MovieClip; //Reference to the parent DataGrid.
function myRenderer(){
}
public function createChildren():Void {
lbl = createClassObject(Label, 'label', 1, {toolTip: 'User names here.'});
lbl.text = "Name";
}
public function getPreferredHeight():Number {
return listOwner.rowHeight;
}
public function layoutChildren():Void {
lbl.setSize(80, listOwner.rowHeight);
}
function setValue(str:String, item:Object, sel:Boolean) : Void {
}
}
Version 1.5
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flex/15/flex_docs_en/00002183.htm