0 Replies Latest reply on Feb 16, 2009 1:46 PM by Todd_Lemoine

    Can't display a DataGrid component as an AdvancedDataGridRendererProvider within Advanced DataGrid

    Todd_Lemoine
      Hi,

      I'm hoping someone can enlighten me about using an ArrayCollection (Array) of Objects as a dataprovider for the AdvancedDataGrid. I feel like I've spent so much time trying to get my grid to do what I want, that I must be misunderstanding something on a fundamental level.

      I want my AdvancedDataGrid (ADG) to display a list of Orders, with a disclosure arrow or folder next to an Order ID that reveals the products associated with the row's Order. Those products would be rendered using a separate DataGrid component as an AdvancedDataGridRendererProvider. Something like this:

      Order ID | Order Vendor | Conf Number
      ============================================
      [-] 102 | ABC Vendor | CONF987
      --------------------------------------------
      Product Name | Product Number
      ========================================
      Widget X | WIDGET-12345
      ----------------------------------------
      Widget Y | WIDGET-67890
      ----------------------------------------
      [+] 101 | DEF Vendor | CONF234
      --------------------------------------------
      [+] 100 | XYZ Vendor | CONF885
      --------------------------------------------


      Something pretty much like this is here (this is from the cookbook site):

      http://www.objectsatellite.com/html/FlexSolutions/ADGWithContainedADG/DataGridWithChildDat aGrid.html

      For my dataprovider, I have an ArrayCollection of Order objects (ordersDataProvider below). Each Order object has an orderItems property that is an Array of Product objects. In debug view, it looks basically like this:

      ordersDataProvider
      [0]
      orderID
      vendor
      confirmationNumber
      orderItems
      [0]
      product_name
      product_number
      [1]
      orderID
      vendor
      confirmationNumber
      orderItems
      [0]
      product_name
      product_number
      [1]
      product_name
      product_number

      My AdvancedDataGrid MXML is below.

      I've fiddled with different attributes and combinations of having the orderItems column included and not and no matter what, I get a simple datagrid with one Order per line and if the orderItems column is included, it lists "[object Product], [object Product]..."

      There must be something basic I'm missing here. Can anyone point me in the right direction?