0 Replies Latest reply on Aug 12, 2011 5:23 AM by nikos101

    spark datagrid that shows the new  value and that it previously was

    nikos101 Level 2

      Im trying to create a item renderer for a spark datagrid that shows the new  value and that it previously was and I am comparing in the set data, the problem I am having is that in teh set data I am frequently getting data from other rows (I know this because of virtual renderders), it there a way round this?


      <?xml version="1.0" encoding="utf-8"?>
      <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                  override public function set data(value:Object):void
                          if(super.data.margin != value.margin  && super.data.margin){
                              oldValue.text = '(' + super.data.margin + ')';
                              oldValue.text == '';
                      super.data = value;
                      stroke.visible = false;
                      fillRect.visible = false;
                              currentState = "modified";
                              fill.color = 0xddddff;
                              stroke.visible = true;
                              fillRect.visible = true;
                              fill.color = 0xffffff;
                              stroke.visible = false;
                              currentState = "unmodified";
                              fillRect.visible = true;
              <s:State name="modified"/>
              <s:State name="unmodified"/>
          <s:Rect top="0" left="0" right="0" bottom="0" id="fillRect" >
              <s:fill><s:SolidColor id="fill"  color="0xFFffff"  /></s:fill>
          <s:Rect left="1" top="1" right="0" bottom="0" id="stroke">
              <s:stroke >
                  <s:SolidColorStroke color="0x000099" weight="1"  >
          <s:HGroup horizontalAlign="center" verticalAlign="middle" top="0" left="0" right="0" bottom="0" paddingRight="5">
              <s:Label text="{data.margin}" width="50%" textAlign="right">
              <s:Label  id="oldValue" color="0xff0000" width="50%"  textAlign="right">