I've been having trouble setting the item renderer of a Spark DataGrid in CSS and then I remembered the compiler creates a class factory for it.
This CSS does not work:
.myGrid {
itemRenderer: ClassReference("myItemRenderer");
}
but declaring it inline it does:
<s:DataGrid itemRenderer="myItemRenderer" />
I found this setStyle
code and put it in the constructor but it doesn't work:
public function DataGrid() {
super();
setStyle("itemRenderer", new ClassFactory(myItemRenderer));
}
I've created a new control and I want to use my custom renderer as default. So all the styles are set in the defaults.css.