2 Replies Latest reply on Apr 21, 2008 1:00 PM by cfwild

    CFGRID - Sum of Column Values

    cfwild Level 1

      Is there a way to sum | total a column of numeric values in a cfgrid? I want to populate a cfinput text box with the number, and bind it so that as changes to numbers occur on the grid, the cfinput box changes.

      I've been able to do this by creating a function that goes and extracts the information via a database query. Running the query seems to add overhead to the screen response time.

      The variable could start as a value passed from a query. Say 2000. When a field changes, it would take the original value, subtract out the original "row" value, then add in the new "row" value. Say a 2 is being replaced by a 3. Then you'd have 2000-2+3 = 2001 which becomes the new "original" total value.

      Any thoughts would be appreciated.

        • 1. Re: CFGRID - Sum of Column Values
          Dan Bracuk Level 5
          The grid and the rest of the web page can't really talk to each other. The grid is either a flash movie or a java applet both of which are self contained.

          Do you absolutely have to use a grid?
          • 2. Re: CFGRID - Sum of Column Values
            cfwild Level 1
            Hi Dan,

            Thanks for the feedback. The grid really works well for what I'm trying to do. I can filter the pages and make minor changes to the data quite quickly. When I add in the extra function (to sum the column) that goes out to the table to extract the data, it seems to take a performance hit on the "page".

            In looking at the code I've seen, it seems easy(?) to get to the new value of the column. Is there a decent way to get to the "old" value of the column, prior to an update? (or as you update)?