Flippie124
02-01-2005, 03:40 PM
hello,
I've created a custom cellrenderer button class. But I don't know how I can pass varibales to this class.
This is my setValue function. As you can see, I need to pass a variable (columnheaderfield) to this class which specifies the field of the item where the button is located. The problem is that I cannot hardcode the name of this field because field names are unknown and dynamically generated. So the second piece of code is how you can do this when you hardcode it.
function setValue(str:String, item:Object, sel:Boolean,columnheaderfield:String) : Void
{
btn._visible = (item!=undefined);
btn.label = item[columnheaderfield].label;
action = item[columnheaderfield].action;
id = item[columnheaderfield].id;
}
function setValue(str:String, item:Object, sel:Boolean) : Void
{
btn._visible = (item!=undefined);
btn.label = item.editfield.label;
action = item.editfield.action;
id = item.edit.id;
}
I've created a custom cellrenderer button class. But I don't know how I can pass varibales to this class.
This is my setValue function. As you can see, I need to pass a variable (columnheaderfield) to this class which specifies the field of the item where the button is located. The problem is that I cannot hardcode the name of this field because field names are unknown and dynamically generated. So the second piece of code is how you can do this when you hardcode it.
function setValue(str:String, item:Object, sel:Boolean,columnheaderfield:String) : Void
{
btn._visible = (item!=undefined);
btn.label = item[columnheaderfield].label;
action = item[columnheaderfield].action;
id = item[columnheaderfield].id;
}
function setValue(str:String, item:Object, sel:Boolean) : Void
{
btn._visible = (item!=undefined);
btn.label = item.editfield.label;
action = item.editfield.action;
id = item.edit.id;
}