1 Reply Latest reply on Apr 13, 2007 9:34 AM by JeremySeverson

    Datagrid losing variableRowHeight when updating data

    JeremySeverson
      Ok so below is my code right now. In the imagePrep field is displaying as a text area so I can have multiple line of htmlText. When I call the xmlDat.send() the first time everythinkg looks good. But then when I click on the update button all my lines go back to single lines and not adjusting to the size the text area component. Anyone have any thoughts on why this would be happening or what the work around is.

      Thanks.



      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()" xmlns:MyComp="myComponents.*">

      <mx:Script>
      <![CDATA[
      import mx.controls.dataGridClasses.DataGridColumn;
      import mx.collections.ArrayCollection;
      import mx.rpc.events.ResultEvent;
      import mx.utils.ArrayUtil;

      [Bindable]private var myData:ArrayCollection;

      private var uintPollInterval:uint = 120000;
      private var timer:Timer = new Timer(uintPollInterval);

      private function initApp():void
      {
      xmlDat.send();
      timer.addEventListener(TimerEvent.TIMER, onTimer);
      timer.start();
      }

      private function onTimer(event:TimerEvent):void
      {
      xmlDat.send();
      }

      private function resultHandler(event:ResultEvent):void{
      myData = event.result.projects.project;
      }

      ]]>
      </mx:Script>

      <mx:HTTPService id="xmlDat" url="data/whiteboard.xml" result="resultHandler(event)"/>

      <mx:Panel layout="vertical" title="Whiteboard" width="958" horizontalCenter="-1" top="10" bottom="10">
      <mx:DataGrid dataProvider="{myData}" height="100%" y="0" x="0" verticalScrollPolicy="on" variableRowHeight="true" editable="false" width="100%" enabled="false">
      <mx:columns>
      <mx:DataGridColumn headerText="Due Date" dataField="dueDate" width="85"/>
      <mx:DataGridColumn headerText="DVD ID" dataField="dvdId" width="65"/>
      <mx:DataGridColumn headerText="School Name" dataField="schoolName" width="235"/>
      <mx:DataGridColumn headerText="City" dataField="city" width="100"/>
      <mx:DataGridColumn headerText="St" dataField="state" width="35"/>
      <mx:DataGridColumn headerText="Qty" dataField="quantity" width="45"/>
      <mx:DataGridColumn headerText="Image Prep" dataField="imagePrep" itemRenderer="render.imgRender"/>
      <mx:DataGridColumn headerText="Video Prep" dataField="videoPrep" itemRenderer="render.vidRender"/>
      <mx:DataGridColumn headerText="Sequencing" dataField="sequencing" itemRenderer="render.seqRender"/>
      <mx:DataGridColumn headerText="FTP" dataField="ftp" itemRenderer="render.ftpRender"/>
      </mx:columns>
      </mx.DataGrid>

      <mx:ControlBar horizontalAlign="right">
      <mx:Button label="Update" click="xmlDat.send()"/>
      </mx:ControlBar>

      </mx:Panel>

      </mx:Application>