0 Replies Latest reply on Jul 6, 2009 6:51 AM by Eliezer Reis

    AdvancedDataGrid expand items

    Eliezer Reis



      Guys, I need some help with AdvancedDataGrid. I'd like expand itens from a ADG without HierarchicalData provider. On my sample below I use a renderer that dissapear columns and I'd like show columns and a VBOX container immediatly below row.


      If you run this code, you will see that my row will be replaced by Renderer and i'd like show rows (this case name e region) and my renderer immediatly below (this case description).


      <?xml version="1.0"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
            import mx.collections.ArrayCollection;
            private var myInfo:ArrayCollection= new ArrayCollection([
              {name:"Barbara Jennings", region: "Arizona", description:"LONG TEXT"},
              {name:"Dana Binn", region: "Arizona", description:"LONG TEXT"},
              {name:"Joe Smith", region: "California", description:"LONG TEXT"},
              {name:"Alice Treu", region: "California", description:"LONG TEXT"}
        <mx:AdvancedDataGrid id="myADG" 
          width="100%" height="100%" 
          variableRowHeight="true" dataProvider="{myInfo}" >
               <mx:AdvancedDataGridColumn dataField="name" headerText="Name"/>
              <mx:AdvancedDataGridColumn dataField="region" headerText="Region"/>
                     renderer="Renderer" /> 


      <?xml version="1.0" encoding="utf-8"?>
      <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
                 paddingTop="0" paddingBottom="0"
                 showInAutomationHierarchy="true" height="100%">
           <mx:HBox id="detailBox" width="100%" horizontalGap="0">
                <mx:HRule width="13" x="0"/>
                <mx:VBox id="content" left="13" right="13" y="0" width="100%" paddingTop="10" 
                           paddingLeft="8" verticalGap="0"
                           borderStyle="solid" cornerRadius="6" 
                           borderSides="left right bottom">
                     <mx:Label id="title" text="{data.description}" />
                <mx:HRule width="13" right="0"/>
           <mx:Box id="detailSpacer" height="4" width="100%" backgroundColor="#ffffff"/>