1 Reply Latest reply on Jan 11, 2007 9:54 AM by upshotvideo

    sum datagrid column values

      I am looking for a way (action script code?) to sum datagrid column values.
      I am using Flex2 with Cold Fusion MX7.

      I populate a DataGrid by setting dataprovider to the result of a Coldfusion query.
      (this.masterList.dataProvider = event.result as ArrayCollection;)
      This all works fine.

      The masterList datagrid has debit, credit, and unitcost columns. I want to sum those columns individually, and display the results in text boxes in another panel.

      I could run a Coldfusion query to return the sums, but would like to do it on the client side with action script.

      I want to sum them everytime I update the datagrid, so need action code that I can put in the result function.

      I am new to ActionScript, and not sure how to loop through the array collection(and/or) dataprovider and sum the items.

      Any help would be appreciated.