1 Reply Latest reply on Jul 10, 2006 12:32 PM by Flex harUI

    data loading problem in dataGrid in final flex2.0 release

    ckshah Level 1
      hi all,

      here is the code which call init user defined function every time when creation complete event fire which bind array collection as dataprovider of DataGrid but problem is its not working means not load datain datagrid..

      [Bindable]
      public var MailList:ArrayCollection;
      [Bindable]
      public var MailListProcessed:ArrayCollection=new ArrayCollection();
      public var storeInfo:Array= new Array();
      public function initDG(event:Event) : void
      {


      elementName=parentApplication.FlashMails.topInboxs.MailFolderLists.selectedItem.@post;
      try{
      MailList = new ArrayCollection(mx.utils.ArrayUtil.toArray(event.target.lastResult.response.mailMessageLi st.mailMessage));
      }catch(err:Error)
      {
      storeInfo[elementName]="";
      MailListProcessed=new ArrayCollection();
      }

      if((storeInfo[elementName])==undefined)
      {
      storeInfo[elementName]=MailList;
      MailListProcessed=storeInfo[elementName];
      }
      else if(parentApplication.FlashMails.topInboxs.blnFlag)
      {
      storeInfo[elementName]=MailList;
      MailListProcessed=storeInfo[elementName];
      }
      }

      ******************************
      binding MailListProcessed as dataprovider to datagrid
      **********************
      <mx:DataGrid tabEnabled="false" id="dgMailList" dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"
      allowMultipleSelection="true" dataProvider="{MailListProcessed}" styleName="DataGrid"
      width="100%" height="100%" borderStyle="none" borderSides="none" cornerRadius="500" focusAlpha="0" textRollOverColor="#ffffff" >
      <mx:columns>
      <mx:Array>
      <mx:DataGridColumn labelFunction="getid" width="0.1" resizable="false" visible="false" />
      <mx:DataGridColumn dataField="contentType" width="0" resizable="false" visible="false"/>
      <mx:DataGridColumn labelFunction="getCCEmail" width="0" resizable="false" visible="false"/>
      <mx:DataGridColumn dataField="flag" headerText="Status" sortable="false" width="50" itemRenderer="mailIconCmp" resizable="false" />
      </mx:Array>
      </mx:columns>
      </mx:DataGrid>
      *******************

      plz tell me what was exact solution for this...

      thanks in advance