1 Reply Latest reply on Feb 24, 2010 3:24 PM by =VA=FyreHeart

    ADG - How to suppress some folders?

    Tawn Kramer

      I have an XML data tree I'm displaying. Some leaf nodes have child data that is used to drive a column display attribute. I don't necessarily want that data to be viewed with a folder icon.

       

      That might be enough info. But I can't help be more verbose. Think of a debugger. A tree of structs. Each struct has member data. We have a snapshot of this member data over time and a slider to scrub through it. The leaf node has an array of data that we wish to drive it's value. But we don't want to see that as a folder.

       

      for example:

       

      struct Foo

      {

           int var;

      }

       

      Foo foo;

      foo.var = 1;

      foo.var = 2;

       

      on frame 1 would display as

       

      (+) foo Foo

        |-  var   int   1

       

      not

       

      (+) foo Foo

        (+)  var   int   1

          |- 1

          |- 2

      I have a custom item renderer for the value field that is driven by the array. That works fine. But I can't suppress the folder icon ( and expandability ).
      Ideas?

        • 1. Re: ADG - How to suppress some folders?
          =VA=FyreHeart Level 2

          What you're trying to do is deceptively simple. Just remove the columns from the group.

           

          For example, the MXML for your

           

          (+) Foo

               (+) foo

                    |- var 1

           

          structure would look something like this:

           

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

                         </mx:fields>
                    </mx:SummaryRow>
               </mx:summaries>

          </mx:GroupingField> 
          ...

          <mx:columns>
               <mx:AdvancedDataGridColumn headerText="Foo" dataField="Foo" width="100"/>
               <mx:AdvancedDataGridColumn headerText="var" dataField="var1" width="100"/>

          </mx:columns>

           

           

          To get rid of it, simply do this to your mx:columns array:

          <mx:columns>
                <mx:AdvancedDataGridColumn headerText="var" dataField="var1"  width="100"/>

          </mx:columns>