1 Reply Latest reply on Apr 6, 2008 4:45 AM by peterskeeter

    How to Access dynamic DG column in item renderer

    peterskeeter
      Hi all,
      I have a combobox itemrenderer and need to access a value from the current row being processed in my item renderer.
      Usually in the
      override public function set data(value:Object):void
      function i would use
      a_recipe = Recipe(value);
      var myid:int = a_recipe.category;
      and access the category that way.

      Now I am playing with dynamic datagrids. In the set function again I have worked out how
      to get the column name, but cant for the life of me work out how to use it to get my value from the
      datagrid.
      Here is my snippet:
      var column:DataGridColumn = (dg) ? dg.columns[listData.columnIndex] as DataGridColumn : null;
      var column_name:String = String(column.dataField);
      var value_from_DG:String = value.column_name; // THIS DOSNT WORK ??

      The last line is my problem. It dosnt look right to me (and dosnt work) how can i use a variable (cloumn_name)
      to access the value property.
      Many Thanks,
      Peter