0 Replies Latest reply on Jul 10, 2007 6:42 AM by Handycam

    Pass variables to itemEditor components?

    Handycam Level 1
      I have a DataGrid on ingredients for a recipe. One column is for the quantity. Since the minimum and maximum amounts of each data row can differ, I have this info stored in my ArrayCollection, like this:

      public var ingredientList2:ArrayCollection = new ArrayCollection([
      {label:"Celery, chopped", quant:1, min2:1, max2:2, units:"cups"},
      {label:"Onions, chopped", quant:1, min2:2, max2:3, units:"cups"} ]);

      The Numeric Stepper component is simple, stored in a file "NSEditor.mxml":

      <mx:NumericStepper xmlns:mx=" http://www.adobe.com/2006/mxml"
      minimum="1"
      stepSize=".5"
      maximum="2"/>

      And then used like so:

      <mx:DataGridColumn dataField="quant" itemEditor="myComponents.NSEditor" editorDataField="value" />

      How can I pass the different Min and Max values to the steppers? Obviously, I need the row of "Celery" to be min=1 max=2, and then Onions has min=2 max=3 (and so on).

      This is a bit important, and I admit I'm stumped.