In init() you can do rowRenderer =
com.mango.controls.ListMenuRow (no quotes).
rowRenderer takes either a String or a
Class, so pass the class in init() and I think you’ll be fine.
Matt
From: Simon Fifield
[mailto:[EMAIL PROTECTED]
Sent: Saturday, March 26, 2005
3:06 AM
To: [EMAIL PROTECTED] Com
Subject: [flexcoders] RowRenderer
for Custom List
I'm trying to extend the List class and the default
SelectableRow rowRenderer. I have successfully extended the List class but
cannot get it to use my RowRenderer.
It works if I use the rowRenderer property in MXML (with the
full class & path - com.mango.controls.ListMenuRow) but I want it to
use my rowRenderer by default - therefore I need to get the extended List to
instantiate my rowRenderer rather than the SelectableRow.
I've tried just overriding:
__rowRenderer : String = "SelectableRow";
__rowRenderer : String = "ListMenuRow";
__rowRenderer : String = "ListMenuRow";
Trying something else.....
I just tried copying the complete code for the
ScrollSelectList into my extended List and changing the Class name etc, and set
the __rowRenderer string to the class name of my new Rowrendere and that
worked...so I can conclude that there is something wrong with my extension of
the List.
import mx.controls.List;
import com.mango.controls.ListMenuRow;
class com.mango.controls.ListMenu2 extends List { var __rowRenderer : String = "com.mango.controls.ListMenuRow";
//Component Class
static var symbolName : String = "ListMenu2";
static var symbolOwner : Object = ListMenu2;
var className : String = "ListMenu2";
// Class Constructor
function ListMenu() {
}
// MXML Component Constructor
function constructObject2(o:Object) : Void
{
super.constructObject2(o);
}
// Component Initialiser
function init() : Void
{
super.init();
}
function createChildren():Void {
super.createChildren();
} // all the below catch mouse events from the rows
function onRowPress(rowIndex : Number) : Void
{
if ( rows[rowIndex].item.separator != "true" ) {
super.onRowPress(rowIndex);
}
}
function onRowRollOver(rowIndex : Number) : Void
{
if ( rows[rowIndex].item.separator != "true" ) {
super.onRowRollOver(rowIndex);
}
}
function onRowDragOver(rowIndex : Number) : Void
{
if ( rows[rowIndex].item.separator != "true" ) {
super.onRowDragOver(rowIndex);
}
}
}
Can anyone see what is wrong with this....my eyes are
getting blurry!
| Yahoo! Groups Sponsor |
ADVERTISEMENT
![click here]() | |
![]() |
Yahoo! Groups Links