DeveloperLearning
asked on
Advanced DataGrid Red/Blue Color Renderer
I am trying to get colors red/blue for the numbering in advanceddatagrid columns. I received solution from Experts-Exchange but it does not seem to work at the line "super.data = value" shown below.
I had to post this question again because I accepted the solution to my original question and now I cannot request it again. Sorry.
The original question is posted under the Title 'Flex : ItemRenderer For blue/red font number color in advanceddatagrid causing grid to slow ' if anyone wants to search for the history.
I get following error
if (value[DataGridListData(li stData).da taField] < 0)
as
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ascripts::ColorRenderer/se t data()[\src\RedBlueColorRe nderer.as: 12]
at mx.controls::AdvancedDataG ridBaseEx/ http://www.adobe.com/2006/flex/mx/internal::setupRendererFromData()[C:\work\f lex\dmv_au tomation\p rojects\da tavisualis ation\src\ mx\control s\Advanced DataGridBa seEx.as:20 47]
at mx.controls::AdvancedDataG ridBaseEx/ measureIte ms()[C:\wo rk\flex\dm v_automati on\project s\datavisu alisation\ src\mx\con trols\Adva ncedDataGr idBaseEx.a s:7058]
at mx.controls::AdvancedDataG ridBaseEx/ commitProp erties()[C :\work\fle x\dmv_auto mation\pro jects\data visualisat ion\src\mx \controls\ AdvancedDa taGridBase Ex.as:1993 ]
at mx.controls::AdvancedDataG rid/commit Properties ()[C:\work \flex\dmv_ automation \projects\ datavisual isation\sr c\mx\contr ols\Advanc edDataGrid .as:2276]
at mx.core::UIComponent/valid atePropert ies()[C:\a utobuild\3 .2.0\frame works\proj ects\frame work\src\m x\core\UIC omponent.a s:5807]
at mx.managers::LayoutManager /validateP roperties( )[C:\autob uild\3.2.0 \framework s\projects \framework \src\mx\ma nagers\Lay outManager .as:539]
at mx.managers::LayoutManager /doPhasedI nstantiati on()[C:\au tobuild\3. 2.0\framew orks\proje cts\framew ork\src\mx \managers\ LayoutMana ger.as:659 ]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callL aterDispat cher2()[C: \autobuild \3.2.0\fra meworks\pr ojects\fra mework\src \mx\core\U IComponent .as:8628]
at mx.core::UIComponent/callL aterDispat cher()[C:\ autobuild\ 3.2.0\fram eworks\pro jects\fram ework\src\ mx\core\UI Component. as:8568]
I had to post this question again because I accepted the solution to my original question and now I cannot request it again. Sorry.
The original question is posted under the Title 'Flex : ItemRenderer For blue/red font number color in advanceddatagrid causing grid to slow ' if anyone wants to search for the history.
I get following error
if (value[DataGridListData(li
as
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ascripts::ColorRenderer/se
at mx.controls::AdvancedDataG
at mx.controls::AdvancedDataG
at mx.controls::AdvancedDataG
at mx.controls::AdvancedDataG
at mx.core::UIComponent/valid
at mx.managers::LayoutManager
at mx.managers::LayoutManager
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callL
at mx.core::UIComponent/callL
package
{
import mx.controls.Label;
import mx.controls.dataGridClasses.DataGridListData;
public class RedBlueColorRenderer extends Label
{
public override function set data(value:Object) : void {
super.data = value;
if (value[DataGridListData(listData).dataField] < 0)
setStyle("color", "red");
else
setStyle("color", "blue");
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER