2 Replies Latest reply on Oct 9, 2007 12:59 PM by Handycam

    Annoying itemRenderer bug

    Handycam Level 1
      I have an item editor/renderer throughout my app. In the past, I hard-coded the min/max, and got the value from my XML. This time around, I am using the XML for all three values.

      Now, all of a sudden, every time I adjust the stepper amount and then drag another item into the grid, the stepper just resets to the default value. Originally, it would stay changed.

      Here's the stepper:
      <mx:VBox xmlns:mx=" http://www.adobe.com/2006/mxml" width="69" height="22">
      <mx:Script>
      <![CDATA[
      public function get newTotal ():Number{
      return step.value;
      }
      ]]>
      </mx:Script>
      <mx:NumericStepper id="step" minimum="{XML(data).@minQy}" maximum="{XML(data).@maxQy}" stepSize=".25" value="{XML(data).@qty}" />
      </mx:VBox>

      And here's the column using it:
      <mx:DataGridColumn dataField="@qty" headerText="Quantity" itemEditor="myComponents.NSEditor" itemRenderer="myComponents.NSEditor" editorDataField="newTotal"/>

      As I said, this very setup worked fine when the stepper used fixed values for min and max.
        • 1. Re: Annoying itemRenderer bug
          peterent Level 2
          If you are using the itemRenderer as the editor, then remove itemEditor property from the DataGridColumn and set rendererIsEditor="true" and editable="true" on the DataGridColumn. You must also have editable="true" on the DataGrid.
          • 2. Re: Annoying itemRenderer bug
            Handycam Level 1
            Thanks. What's happening exactly is:
            -- drag an item from on grid to this grid
            -- edit the stepper amount
            -- drag a second item into the grid
            -- the first item re-sets to the default, removing your edit

            This is also true if:
            -- drag two or more items over, edit their amounts. They all edit fine.
            -- drag another item, they re-set

            I'm not sure why this works like this when it used to work fine. You can see the first issue of this app at Fine Cooking Create Your Own Recipe. You'll need to sign up for a free membership to see it (sorry).