1 Reply Latest reply on Jan 10, 2008 11:17 AM by paulfeuer

    Alternate array values - Help!

    Handycam Level 1
      OK, my recipe has its ingredients chosen from datagrids populated by an XML file, with data such as:
      <item ln1="Apples" ln2="chopped apples" sn="apples" minQy="0" maxQy=".5" qty=".25" units="cup" />
      <item ln2= etc etc

      The user selects the ingredients, and then all the steps are concatenated and displayed in one data grid, as in:
      <mx:DataGridColumn dataField="@qty" headerText="Amount" />
      <mx:DataGridColumn dataField="@units" headerText="Units" />
      <mx:DataGridColumn dataField="@ln2" headerText="Ingredient" />

      This works fine, but my problem is the client now wants one of the lists to display with alternate values in the master display grid. Instead of ".5 cups chopped apples", "1 large chopped apples".

      So, essentially I need to multiply each chosen ingredient by a different factor (here X2 to make .5 cup into 1 apple) and substitute the unit.

      They're all different. In the example above, the apple's new unit is "large" and I multiply the selected value by 2, but others might be "lbs." and "x 4".

      To make it a bit more challenging, I only want to modify the way it's displayed in this list -- the original list values (above, ".5 cup apples" needs to still be displayed on that screen.

      Ideas really appreciated.
        • 1. Re: Alternate array values - Help!
          paulfeuer Level 1
          i'd negotiate with the client and try to simplify the requirements.

          for example, provide an option that says "Double Quantities" that would multiply everything by 2.

          if you procede down the pathway that your client suggests, it sounds like a lot of special cases and a lot of code. from you're description, it seems like the alteration is totally and completely arbitrary and not something easily reducable into a rule that could be executed simply in code.