1 Reply Latest reply on Jul 2, 2009 7:06 AM by flashharry!

    using a (Adv)datagrid as an AdvancedDataGridRendererProvider

    flashharry! Level 1

      HI

       

      I have nested array(Hierarchical) data. I want to display the toplevel array as depth1 in an Advanced Data Grid, then at depth 2 when the data (tree) is opened display the nested array in another grid(advanced or normal).

       

      This works to some degree, but as expected the item renderer renders a grid for each row of nested data.  What I want is one grid with all the nested data. The way nested data shows normally is to have both headers for each depth showing in the main grid.. I only want to show the headers and nested data if the user chooses to do so.

       

      I can arrange the data anyway that is needed, as I'm pulling it from mysql via php.

       

      This is my renderer (simple)

      <?xml version="1.0" encoding="utf-8"?>

      <VBox xmlns="http://www.adobe.com/2006/mxml" width="100%" height="200">

      <AdvancedDataGrid  dataProvider="{data}" width="100%" height="100%" >

      <columns>

      <AdvancedDataGridColumn dataField="pp_job_number" headerText="Job Number"/>

      <AdvancedDataGridColumn dataField="pp_short_description" headerText="Description"/>

      <AdvancedDataGridColumn dataField="approvalmanufacturing" headerText="Final Date"/>

      </columns>

      </AdvancedDataGrid>

      </VBox>

       

      This is my grid

      <AdvancedDataGrid sortExpertMode="true"

      id="contractsGrid" width="100%" height="100%" itemClick="openContractForEditting(event)"

      variableRowHeight="true" defaultLeafIcon="{null}"

      folderOpenIcon="{editImage}" folderClosedIcon="{editImage}"

      >

      <rendererProviders>

      <AdvancedDataGridRendererProvider

      columnIndex="1"

      columnSpan="0"

      depth="2"

      renderer="view.jobRenderForAdvancedDataGrid"/>

      </rendererProviders>

      <dataProvider>

      <HierarchicalData source="{contracts_array}" childrenField="jobinfo" />

      </dataProvider>

      </AdvancedDataGrid>

       

      I can get the grid the way I want but have depth issues.

       

      if I add dataField="jobinfo" to AdvancedDataGridRendererProvider and then change the renderers' data provider to dataProvider="{data.jobinfo}"

       

      Then I get all the nested data in one grid, BUT the grid is not nested it will only show up at depth 1, on top of all the main details.

       

      help

       

      TIA

      flash

        • 1. Re: using a (Adv)datagrid as an AdvancedDataGridRendererProvider
          flashharry! Level 1

          Figured it out, I had to nest my array.......

           

          Array
          (
              [0] => Array
                  (
                      [0] => Array
                          (
                              [contracts_id] => 2
                              [contract_number] => MD-BLD-LA-XXXXX-01
                              [property_name] => Blue Bus
                              [licensee_name] => Ripple Bus
                              [formated_contract_start_date] => Wed Jan 14th, 2009
                              [formated_contract_end_date] => Tue Mar 31st, 2009
                              [contract_recived] => 0
                              [main_contact] => Test User RJ1
                              [bu_contact] => fred ward
                              [licensor_name] => MediaBus
                              [brand_liaison] => fred ward
                              [brand_liaison_bu] => fred ward
                              [brand_manager] => fred ward
                              [children] => Array                         (                             [0] => Array                                 (                                     [jobinfo] => Array                                         (                                             [0] => Array                                                 (                                                     [pp_job_number] => MD-BR-LA-34527-01-FREDTEST                                                     [pp_short_description] => FRED comments                                                     [approvalmanufacturing] =>                                                 )                                             [1] => Array                                                 (                                                     [pp_job_number] => MD-BR-LA-34527-01-1234                                                     [pp_short_description] => hh                                                     [approvalmanufacturing] =>                                                 )                                             [2] => Array                                                 (                                                     [pp_job_number] =>                                                     [pp_short_description] => comment                                                     [approvalmanufacturing] =>                                                 )