0 Replies Latest reply on Aug 26, 2009 10:40 AM by majester8425

    My data disappears or moves rows when using a dateField Itemrenderer and Scrolling the dataGrid??

    majester8425

      I am using a simple dateField itemrenderer (code as below). When I scroll up or down in the DataGrid, any Date I enter either appears to jump rows or disappears. I have seen a number of solutions, but none seem to work. I have tried all these options but none work. Any Ideas

       

      dispatching an event in the Override public function (dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));)

      setting the renderer with and height to a size

      setting dataChange="validateNow();" within the renderer.

       

      My Code :

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:HBox xmlns:mx="
      http://www.adobe.com/2006/mxml
             horizontalAlign="center"
             verticalGap="0">

             <mx:DateField id="applyOnDtFld"
                           change="onEdit(event);"
                           yearNavigationEnabled="true"
                           selectableRange="{{rangeStart : new Date()}}"/>

          <mx:Script>
          <![CDATA[
            
              private function onInitialize():void
              {
              }
             
              private function onEdit(evt:Event):void
              {
                  data.wrApplyOnDt = evt.currentTarget.text;
              }       
             
              override public function set data(value:Object):void
              {
                  super.data = value;

                  if(value.wrApplyOnDt != null && value.leaveApply == null)
                  {
                      applyOnDtFld.text = value.wrApplyOnDt;
                      applyOnDtFld.editable = false;
                      applyOnDtFld.enabled = false;
                      applyOnDtFld.setStyle("fontWeight", "bold");
                      applyOnDtFld.setStyle("disabledColor", "green");
                  }
                  else
                  {
                      applyOnDtFld.editable = true;
                      applyOnDtFld.enabled = true;
                  }
              }
             
          ]]>
          </mx:Script>

      </mx:HBox>