3 Replies Latest reply on Feb 15, 2010 11:04 AM by rick@cat

    How do I identify parent item in ADG


      Hi All,

      Is there any way to identify whether or not you are in a top level (parent) row when using HierarchicalData in an ADG?


      Id like to have a checkbox in one of the columns but ONLY for the parent rows and can't seem to find a way to accomplish that. I have an itemRenderer for the checkbox now but it's showing in all the rows, parent and all children when opened.


      Thanks in advance,


        • 1. Re: How do I identify parent item in ADG
          chris.huston.t10 Level 3

          Have you tried setting the depth parameter for the AdvancedDataGridRendererProvider? This is a way to control what level your renderer appears in the hierarchy.


             <mx:AdvancedDataGridRendererProvider columnIndex="3" depth="2"



          • 2. Re: How do I identify parent item in ADG
            rick@cat Level 1


            Thanks, that worked. Now my issue is referencing the function I have for the click event of the checkbox since the code is now moved out of my equipment.mxml file. I've been working with flex for about 3 months now and I always have an issue with this. Here's what i tried:


            <?xml version="1.0" encoding="utf-8"?>
            <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
                        import mx.core.Application;
                        toolTip="Click to create a work order."
                        horizontalCenter="0" verticalCenter="0"/>


            The toggleWorkOrder function is public but it's not being activated when I click the box.


            Any Ideas?


            Thanks again,


            • 3. Re: How do I identify parent item in ADG
              rick@cat Level 1

              I found the answer here:




              Since the (true) parent of the itemRenderer is a loaded module, I needed to reference my moduleLoader (contentLoader is its ID) in the main application like this:




              That works fine.