0 Replies Latest reply on Sep 6, 2006 4:34 AM by Romadur

    How to set the labelFunction of a DataGridColumn?

    Romadur
      I want to set the label function of a DataGridColumn with JavaScript. I created the column with the following JavaScript code.

      var valueColumn = FABridge.example.create("mx.controls.dataGridClasses.DataGridColumn");
      valueColumn.setHeaderText("Value");
      valueColumn.setDataField("stringValue");
      var valueColumnLabel = function (item,column) { return "test label"; }
      valueColumn.setLabelFunction(valueColumnLabel);

      But the hardcoded label "test label" does not work. It looks like the valueColumnLabel JavaScript function does not return the string "test label" to flex. If I exchange the line
      var valueColumnLabel = function (item,column) { return "test label"; }

      with
      var valueColumnLabel = function (item,column) { alert("test label"); }

      then flash opens a JavaScript alert box for each coulmn/row tuple. So the code got executed

      Any idea how to set the labelFunction form JavaScript?

      Regards

      Romadur