0 Replies Latest reply on Apr 17, 2008 5:23 AM by FlexyBoy

    Dynamic Advanced Data Grid

    FlexyBoy
      Hello,

      I am having problems to populate my advanced datagrid. Though the grid is getting headers, it is not getting the data from my datasource (Please note that I am using a cfc functions called "getOrds" to retrieve the data.

      Am I missing something in the code??

      It would be great if someone could help me out with this one.

      ------------------------------------------------------------------------------------------ ---------------------------------------------------------
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical">

      <mx:Script>
      <![CDATA[
      import mx.collections.IHierarchicalCollectionView;
      [Bindable]
      [Bindable]
      public var ords:ArrayCollection = new ArrayCollection;


      public function getOrds(event:ResultEvent):void
      {
      ords = event.result as ArrayCollection;
      }

      ]]>
      </mx:Script>


      <mx:AdvancedDataGrid id="adg" x="28" y="64" width="609" height="228" creationComplete="gc2.refresh();"
      initialize="gc2.refresh();" designViewDataType="tree"
      defaultLeafIcon="{null}" folderClosedIcon="{null}"
      folderOpenIcon="{null}" >
      <mx:dataProvider>
      <mx:GroupingCollection id="gc2" source="{ords}" >

      <mx:Grouping>

      <mx:GroupingField name="rule_no" >
      <mx:summaries>
      <mx:SummaryRow summaryPlacement="group">
      <mx:fields>
      <mx:SummaryField dataField="rule_no" operation="SUM" />
      </mx:fields>
      </mx:SummaryRow>
      </mx:summaries>
      </mx:GroupingField>

      <mx:GroupingField name="cakes">
      <mx:summaries>
      <mx:SummaryRow summaryPlacement="group" >
      <mx:fields>
      <mx:SummaryField dataField="cakes" operation="COUNT" />
      </mx:fields>
      </mx:SummaryRow>
      </mx:summaries>
      </mx:GroupingField>

      </mx:Grouping>

      </mx:GroupingCollection>
      </mx:dataProvider>

      <mx:groupedColumns>

      <mx:AdvancedDataGridColumn headerText="rule_no" />
      <mx:AdvancedDataGridColumn headerText="Cakes" dataField="cakes"/>
      </mx:groupedColumns>
      </mx:AdvancedDataGrid>


      <mx:RemoteObject id="myService" destination="ColdFusion" source="components.AdvancedDG" showBusyCursor="true" fault="Alert.show(event.fault.message,'Error')">
      <mx:method name="getOrds" result="getOrs(event)"/>
      </mx:RemoteObject>



      </mx:Application>