Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFGRID - Sum of Column Values

Guest
Apr 21, 2008 Apr 21, 2008
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
TOPICS
Advanced techniques
847
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2008 Apr 21, 2008
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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 21, 2008 Apr 21, 2008
LATEST
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)?

cfwild
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources