0 Replies Latest reply on Dec 14, 2009 10:18 AM by acoquinar

    Please help populate AdvancedDataGrid !...

    acoquinar Level 1

      It should be simple and trivial but i've been trying for hours now and can't find any help on the net.

       

      See the code below as well as a screenshot of what i try to acheive.

       

       

      Thanks !

       

       

      sc..png

       

      The XML data:

      <mx:XMLList id="dpHierarchyXML" >
      <node name="sdc">
          <node name="sdc1">
              <element key="mount">PART OF...</element>
              <element key="size">240365120</element>
              <element key="avail">2403651</element>
          </node>
          <node name="sdc2">
              <element key="mount">PART OF...</element>
              <element key="size">240365120</element>
              <element key="avail">2403651</element>
          </node>
          <node name="sdc5">
              <element key="mount">PART OF...</element>
              <element key="size">240365120</element>
              <element key="avail">2403651</element>
          </node>
      </node>
      </mx:XMLList>

       

      The DataGrid code:

           <mx:AdvancedDataGrid  id="partitionList" designViewDataType="tree" width="100%" height="400" sortableColumns="false" >
                <mx:dataProvider>
                 <mx:HierarchicalData id="HierarchicalDataSource" source="{dpHierarchyXML}"/>
               </mx:dataProvider>
              

                <mx:columns>  //WHAT FOLLOWS IS OBVIOUSLY WRONG (See each dataField values...)
                     <mx:AdvancedDataGridColumn headerText="Device" dataField="@name"/>
                     <mx:AdvancedDataGridColumn headerText="Partition" dataField=".@name"/>
                     <mx:AdvancedDataGridColumn headerText="Mount" dataField="node.node.mount"/>
                     <mx:AdvancedDataGridColumn headerText="Size" dataField="node.node.size"/>
                     <mx:AdvancedDataGridColumn headerText="Available" dataField="node.node.avail"/>
                </mx:columns>
           </mx:AdvancedDataGrid>