title: How can i make a reusable labelFunction for Flex Datagrid?
body: <p>I have a label function like :</p>
  
  <pre><code>private function formatDate (item:Object, column:DataGridColumn):String
  {
      var df:DateFormatter = new DateFormatter();
      df.formatString = "MM/DD/YY";
  
      if (column.dataField == "startDate") {
          return df.format(item.startDate);
      }
  
      return "ERR";
  }
  </code></pre>
  
  <p>Which I use in a datacolumn by using <code>labelFunction</code>.</p>
  
  <p>This works just fine if my data field is called 'startDate'. I want to make this function generic so I can use it everywhere.</p>
  
  <p>How can I do this. i think i need to use some kind of 'reflection' - or perhaps another approach altogether?</p>