none
[openafs-wiki.git] / TWiki / VarEDITTABLE.mdwn
1 <a name="VarEDITTABLE"></a>
2
3 ### <a name="EDITTABLE{ &lt;em&gt;attributes&lt;/em&gt; } -- edi"></a> EDITTABLE\{ _attributes_ \} -- edit TWiki tables using edit fields and other input fields
4
5 - The `%EDITTABLE{}%` variable is handled by the [[EditTablePlugin]]
6 - Syntax: <code>%EDITTABLE\{ _attributes_ \}%</code>
7
8 - Supported attributes: <table border="1" cellpadding="0" cellspacing="0">
9   <tr>
10     <th bgcolor="#99CCCC"><strong> Attribute </strong></th>
11     <th bgcolor="#99CCCC"><strong> Comment </strong></th>
12     <th bgcolor="#99CCCC"><strong> Default </strong></th>
13   </tr>
14   <tr>
15     <td><code>header</code></td>
16     <td> Specify the header format of a new table like <code>"%VBAR%*Food*%VBAR%*Drink*%VBAR%"</code>. Useful to start a table with only a button </td>
17     <td> (no header) </td>
18   </tr>
19   <tr>
20     <td><code>format</code></td>
21     <td> The format of one column when editing the table. A cell can be a text input field, or any of these edit field types:%BR% %BB% Text input field (1 line):%BR%   <code>%VBAR% text, &lt;size&gt;, &lt;initial value&gt; %VBAR%</code> %BR% %BB% Textarea input field:%BR%   <code>%VBAR% textarea, &lt;rows&gt;x&lt;columns&gt;, &lt;initial value&gt; %VBAR%</code> %BR% %BB% Drop down box: %BR%   <code>%VBAR% select, &lt;size&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc* %VBAR%</code> %BR%   <code>*</code> only one item can be selected %BR% %BB% Radio buttons: %BR%   <code>%VBAR% radio, &lt;size*&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc %VBAR%</code> %BR%   <code>*</code> size indicates the number of buttons per line in edit mode %BR% %BB% Checkboxes: %BR%   <code>%VBAR% checkbox, &lt;size*&gt;, &lt;option 1&gt;, &lt;option 2&gt;, etc %VBAR%</code> %BR%   <code>*</code> size indicates the number of checkboxes per line in edit mode %BR% %BB% Fixed label: %BR%   <code>%VBAR% label, 0, &lt;label text&gt; %VBAR%</code> %BR% %BB% Row number: %BR%   <code>%VBAR% row, &lt;offset&gt; %VBAR%</code> %BR% %BB% Date: %BR%   <code>%VBAR% date, &lt;size&gt;, &lt;initial value&gt;, &lt;DHTML date format&gt; %VBAR%</code> (see [[Main/WebHome#DateField]]) </td>
22     <td><code>"text, 16"</code> %BR% for all cells </td>
23   </tr>
24   <tr>
25     <td><code>changerows</code></td>
26     <td> Rows can be added and removed if <code>"on"</code><br /> Rows can be added but not removed if <code>"add"</code><br /> Rows cannot be added or removed if <code>"off"</code></td>
27     <td><code>CHANGEROWS</code> %BR% plugin setting </td>
28   </tr>
29   <tr>
30     <td><code>quietsave</code></td>
31     <td> Quiet Save button is shown if <code>"on"</code>, hidden if <code>"off"</code></td>
32     <td><code>QUIETSAVE</code> %BR% plugin setting </td>
33   </tr>
34   <tr>
35     <td><code>include</code></td>
36     <td> Other topic defining the EDITTABLE parameters. The first %EDITTABLE% in the topic is used. This is useful if you have many topics with the same table format and you want to update the format in one place. </td>
37     <td> (none) </td>
38   </tr>
39   <tr>
40     <td><code>helptopic</code></td>
41     <td> Topic name containing help text shown below the table when editing a table. The %STARTINCLUDE% and %STOPINCLUDE% variables can be used in the topic to specify what is shown. </td>
42     <td> (no help text) </td>
43   </tr>
44   <tr>
45     <td><code>headerislabel</code></td>
46     <td> Table header cells are read-only (labels) if <code>"on"</code>; header cells can be edited if <code>"off"</code> or "0" </td>
47     <td><code>"on"</code></td>
48   </tr>
49   <tr>
50     <td><code>editbutton</code></td>
51     <td> Set edit button text, e.g. <code>"Edit this table"</code>; set button image with alt text, e.g. <code>"Edit table, %PUBURL%/%TWIKIWEB%/TWikiDocGraphics/edittopic.gif"</code>; hide edit button at the end of the table with <code>"hide"</code> (Note: Button is automatically hidden if an edit button is present in a cell) </td>
52     <td><code>EDITBUTTON</code> %BR% plugin setting </td>
53   </tr>
54   <tr>
55     <td><code>buttonrow</code></td>
56     <td> Set to <code>top</code> to put the edit buttons above the table. </td>
57     <td><code>bottom</code></td>
58   </tr>
59   <tr>
60     <td><code>javascriptinterface</code></td>
61     <td> Use javascript to directly move and delete row without page refresh. Enable with <code>"on"</code>, disable with <code>"off"</code>. </td>
62     <td><code>JAVASCRIPTINTERFACE</code> %BR% plugin setting </td>
63   </tr>
64 </table>
65
66 - Example:%BR% `%EDITTABLE{ format="| text, 20 | select, 1, one, two, three |" changerows="on" }%` %BR% `| *Name* | *Type* |` %BR% `| Foo | two |`
67 - Related: See [[EditTablePlugin]] for more details