Question
I need an
EDITTABLE to have a column with some cells defined as EDITCELLS and others taking their values from previously defined variables.
e.g. The following...
%CALC{$SET(answer, No)}%
%TABLE{databg="none", dataalign="center, left"}%
%EDITTABLE{ header="on" defaultrows="on" format="| label, 0 | label, 0 | label, 0 | select, 1, , Fred, Bob | date, , ,%Y-%m-%d|" changerows="off"}%
| *Step No.* | *Description* | *Done?* | *Who* | *Date Complete* |
| 1 | Step 1. | %CALC{$GET(answer)}% | | |
| 2 | Step 2. | Yes %EDITCELL{select,1, ,Yes,No}% | | |
produces...
Please don't save this table!
The trouble is that as soon as the table is saved the CALC is expanded. This means that if the variable set previously changes the table isn't updated.
Does anyone have any suggestions for alternative solutions. I read
EditTableWithFormulas but placing the CALC in the header didn't work.
Environment
--
DavidBaker - 25 Apr 2006
Answer
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.
Looking at that topic it's in a label in the header with % as $percnt and then as normal in the cell. Let's try that:
Here's what I did
%CALC{$SET(answer, No)}%
%TABLE{databg="none", dataalign="center, left"}%
%EDITTABLE{ header="on" defaultrows="on" format="|label,0|label,0|label,0,$percntCALC{$GET(answer)}$percnt|select,1,,Fred,Bob|date,,,%Y-%m-%d|" changerows="off"}%
| *Step No.* | *Description* | *Done?* | *Who* | *Date Complete* |
| 1 | Step 1. | %CALC{$GET(answer)}% | | |
| 2 | Step 2. | Yes %EDITCELL{select,1, ,Yes,No}% | | |
Edited the table and the CALC is preserved, however the edit I made to the table didn't get saved :/
--
SamHasler - 25 Apr 2006
I wonder if having two almost identical tables in the topic is causing problems?
Yes it was, try it in
Sandbox.EditTableWithCALC
I've changed the status to
AnsweredQuestions.
--
SamHasler - 25 Apr 2006
That's great - Thanks Sam. Unfortunately it doesn't work on my system. I copied your sandbox example to my system to try out. The %CALC... is translated to 'Yes' in the table cell when the table is saved. I can only think its something to do with my version of
EditTable - I'm using the version that enables new rows to be inserted mid table. (I can't find the original link to this version)
--
DavidBaker - 25 Apr 2006