Ok, I created another renderer:

public class AssetReportColorRenderer2 extends VBox implements
IDropInListItemRenderer
{
public function AssetReportColorRenderer2()
{
super();
}
 public function get listData():BaseListData
{
return null;
}
 public function set listData(value:BaseListData):void
{
super.data = value;
if (value)
{
var _label:Label = new Label();
_label.text = value["item"].@Scope;
this.setStyle("backgroundColor", value["item"].@Hex);
}
}
}

That works a bit better - I see colors, but as soon as I touch mouse to
scroll it fails:
TypeError: Error #1009: Cannot access a property or method of a null object
reference.
at
mx.controls.listClasses::AdvancedListBase/scrollVertically()[C:\work\flex\dmv_automation\projects\datavisualization\src\mx\controls\listClasses\AdvancedListBase.as:6289]
at
mx.controls::AdvancedDataGridBaseEx/scrollVertically()[C:\work\flex\dmv_automation\projects\datavisualization\src\mx\controls\AdvancedDataGridBaseEx.as:2608]
at mx.controls.listClasses::AdvancedListBase/set
verticalScrollPosition()[C:\work\flex\dmv_automation\projects\datavisualization\src\mx\controls\listClasses\AdvancedListBase.as:1186]
at mx.controls::AdvancedDataGridBaseEx/set
verticalScrollPosition()[C:\work\flex\dmv_automation\projects\datavisualization\src\mx\controls\AdvancedDataGridBaseEx.as:963]
at mx.controls::AdvancedDataGrid/set
verticalScrollPosition()[C:\work\flex\dmv_automation\projects\datavisualization\src\mx\controls\AdvancedDataGrid.as:1209]
at
mx.controls.listClasses::AdvancedListBase/mouseWheelHandler()[C:\work\flex\dmv_automation\projects\datavisualization\src\mx\controls\listClasses\AdvancedListBase.as:7416]
at
mx.controls::AdvancedDataGridBaseEx/mouseWheelHandler()[C:\work\flex\dmv_automation\projects\datavisualization\src\mx\controls\AdvancedDataGridBaseEx.as:6992]
at
mx.controls::AdvancedDataGrid/mouseWheelHandler()[C:\work\flex\dmv_automation\projects\datavisualization\src\mx\controls\AdvancedDataGrid.as:8467]


On Thu, Nov 6, 2014 at 12:28 PM, mark goldin <[email protected]> wrote:

> Right, I got that. But no colors in the column regardless.
>
> On Thu, Nov 6, 2014 at 12:26 PM, Alex Harui <[email protected]> wrote:
>
>> setStyle can handle some color names, but TextField’s backgroundColor
>> cannot.  It has to be a uint.
>>
>> -Alex
>>
>> On 11/6/14, 10:09 AM, "mark goldin" <[email protected]> wrote:
>>
>> >I am getting results I cannot comprehend.
>> >this.getTextField().setStyle("backgroundColor", "Red");
>> >if (this.getTextField().backgroundColor != null)
>> >trace(this.getTextField().backgroundColor);
>> >
>> >This code will trace out a number 16777215 btu no color in cells.
>> >
>> >But:
>> >this.getTextField().backgroundColor = "Red";
>> >if (this.getTextField().backgroundColor != null)
>> >trace(this.getTextField().backgroundColor);
>> >
>> >will output 0.
>> >
>> >BTW, I am using this renderer for ADG column.
>> >
>> >Thanks
>> >
>> >
>> >On Thu, Nov 6, 2014 at 11:20 AM, Alex Harui <[email protected]> wrote:
>> >
>> >> Try skipping setStyle:
>> >>
>> >> this.getTextField().backgroundColor = 0xFFA500;
>> >>
>> >>
>> >> If that doesn’t work, there might be other code that removes
>> backgrounds
>> >> when a renderer so the highlights for rollover show through.   Check
>> the
>> >> base class for logic that does that.
>> >>
>> >> -Alex
>> >>
>> >> On 11/6/14, 8:36 AM, "mark goldin" <[email protected]> wrote:
>> >>
>> >> >I did.
>> >> >
>> >> >On Thu, Nov 6, 2014 at 10:32 AM, OmPrakash Muppirala
>> >> ><[email protected]>
>> >> >wrote:
>> >> >
>> >> >> Try removing the quotes around the color value.
>> >> >> On Nov 6, 2014 7:48 AM, "mark goldin" <[email protected]>
>> wrote:
>> >> >>
>> >> >> > I am using a label for my custom renderer:
>> >> >> >
>> >> >> > override public function set data(value:Object):void
>> >> >> > {
>> >> >> > super.data = value;
>> >> >> > if (value != null)
>> >> >> > {
>> >> >> > this.getTextField().background = true;
>> >> >> > this.getTextField().setStyle("backgroundColor", "0xFFA500");
>> >> >> > }
>> >> >> > }
>> >> >> > private function getTextField():*
>> >> >> > {
>> >> >> > return textField;
>> >> >> > }
>> >> >> >
>> >> >> > But I see no color.
>> >> >> >
>> >> >> > Thanks
>> >> >> >
>> >> >>
>> >>
>> >>
>>
>>
>

Reply via email to