Tags:
create new tag
view all tags

Question

Hello, I have an Edit Table where users can add rows containing various numbers. I want to have a row that always remains at the bottom and is a calculation of the above (using %CALC) Any ideas how this can be done so the users can't edit the "Total" Row?

Component Dev Unit Test SA Test QA Test UAT Release to QA Release to Stage Release to Live Comment
xyz 1 1 1 1 10 1 1 ertyery
abc 1 1 7 1 12 3 2 ertyer
Total 2 2 8 2 22 4 3 Total
123 1 1 5 4 2 1 1  

Environment

TWiki version: TWikiRelease04Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories:  

-- JamesBarker - 02 Feb 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

A simple solution is to turn those cells into header cells (as I did with your example). You can also try to use %EDITCELL{}% of type label.

-- PeterThoeny - 02 Feb 2006

Thanks Peter but as you can see that has not solved my problem I need the total row to always be at the botton even when a new row has been added to the table

-- JamesBarker - 03 Feb 2006

Hmm, barring changing the EditTable plugin we need a function that is the analog of ABOVE() called BELOW() - return the range of cells below the current cell. Then you can calc your totals in a hidden row at the top then stuff them into vaiables and refer to those variables in a separate "totals" table.

OR, teach EditTable to ignore "footer" lines when adding rows!

-- SteveRJones - 04 Feb 2006

This Plugin does not support footer rows at this time.

You can run the totals after the table. $ROW() still holds the value of the last row, so you can run the totals even if the CALC is outside the table. However, you cannot calculate the totals in a new table because this resets the table values. As a workaround you can do the CALCs in a HTML table; or you can do the CALC after the table, assigning the totals to CALC variables, then read & display the variables in new table below the edit table. You would need to define the column widths so that the tables columns align.

-- PeterThoeny - 05 Feb 2006

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2006-02-05 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.