3 Replies Latest reply on Sep 30, 2008 1:19 PM by nikos101

    Is there a better way to do the label functions than the following:

    nikos101 Level 2
      Say I have a datagrid with 3 columns to display money and 1 column for text, is there a better way to do the label functions than the following:

      private function price_labelFuncHSBC(item:Object, column:DataGridColumn):String {
      return currencyFormatter.format(item.HSBC);
      }
      private function price_labelFuncNatWest(item:Object, column:DataGridColumn):String {
      return currencyFormatter.format(item.NatWest);
      }
      private function price_labelFuncLloydsTSB(item:Object, column:DataGridColumn):String {
      return currencyFormatter.format(item.LloydsTSB);
      }

      This would be a pain to do if there were 10 columns each haing a different label field.