Question
CFGRID - Sum of Column Values
Hi,
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.
cfwild
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.
cfwild
