CGI %EDITTABLE{}% directly above the table. This can be added to tables that are formatted with TablePlugin: add the CGI EDITTABLE variable just above or below the CGI TABLE tag. It can also be used without any CGI TABLE tag.
Customize entry fields by specifying the format: use a text field, a drop down box, a date field, radio buttons or checkboxes.
Multiple tables per topic are editable, but only one at a time can be edited.
CGI %EDITTABLE{...}% variable just before an existing table to make it editable, or add the variable anywhere in a topic to start a new table.
| Attribute | Comment | Default |
|---|---|---|
CGI header | Specify the header format of a new table like CGI "|*Food*|*Drink*|". Useful to start a table with only a button | (no header) |
CGI format | The format of one column when editing the table. A cell can be a text input field, or any of these edit field types: • Text input field (1 line): CGI | text, <size>, <initial value> | • Textarea input field: CGI | textarea, <rows>x<columns>, <initial value> | • Drop down box: CGI | select, <size>, <option 1>, <option 2>, etc* | CGI * only one item can be selected • Radio buttons: CGI | radio, <size*>, <option 1>, <option 2>, etc | CGI * size indicates the number of buttons per line in edit mode • Checkboxes: CGI | checkbox, <size*>, <option 1>, <option 2>, etc | CGI * size indicates the number of checkboxes per line in edit mode • Fixed label: CGI | label, 0, <label text> | • Row number: CGI | row, <offset> | • Date: CGI | date, <size>, <initial value>, <DHTML date format> | (see Date Field Type) | CGI "text, 16" for all cells |
CGI changerows | Rows can be added and removed if CGI "on" Rows can be added but not removed if CGI "add" Rows cannot be added or removed if CGI "off" | CGI CHANGEROWS plugin setting |
CGI quietsave | Quiet Save button is shown if CGI "on", hidden if CGI "off" | CGI QUIETSAVE plugin setting |
CGI include | 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. | (none) |
CGI helptopic | 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. | (no help text) |
CGI headerislabel | Table header cells are read-only (labels) if CGI "on"; header cells can be edited if CGI "off" or "0" | CGI "on" |
CGI editbutton | Set edit button text, e.g. CGI "Edit this table"; set button image with alt text, e.g. CGI "Edit table, %PUBURL%/%TWIKIWEB%/TWikiDocGraphics/edittopic.gif"; hide edit button at the end of the table with CGI "hide" (Note: Button is automatically hidden if an edit button is present in a cell) | CGI EDITBUTTON plugin setting |
CGI javascriptinterface | Use javascript to directly move and delete row without page refresh. Enable with CGI "on", disable with CGI "off". | CGI JAVASCRIPTINTERFACE plugin setting |
CGI <initial value> (of text input field) and CGI <label text> (of fixed label) get expanded when a new row is added. This can be used for example to add a timestamp to a label. You can escape characters with format tokens if you do not want that.
Any TWiki variable inside a table cell will be preserved. For instance, CGI %TOPIC% will not get expanded to the current topic name.
The format tokens are the same as with FormattedSearch:
| Escape: | Expands To: |
|---|---|
CGI $n or CGI $n() |
New line. Use CGI $n() if followed by alphanumeric character, e.g. write CGI Foo$n()Bar instead of CGI Foo$nBar |
CGI $nop or CGI $nop() |
Is a "no operation". |
CGI $quot |
Double quote (CGI ") |
CGI $percnt |
Percent sign (CGI %) |
CGI $dollar |
Dollar sign (CGI $) |
The CGI date field type allows one to choose a date with a popup calendar. Popup calendar works with all modern browsers. The date picker button is inactive if the browser cannot support the popup calendar or if javascript is disabled.
CGI %EDITCELL{ "type, ..." }% variable at the end of the cell content. This is useful to override the per column CGI %EDITTABLE{ format="..." }% settings, or to create tables with key/value rows. All edit field types of the CGI format="..." parameter are supported. For example, to define a text field, type: CGI | cell content %EDITCELL{ "text, 20" }% |
It is also possible to place the edit button inside a cell instead of default location below the table. Type CGI | %EDITCELL{ "editbutton, 1, Edit this table" }% | to show a button, or CGI | %EDITCELL{ "editbutton, 1, Edit table, Image-URL" }% | to show a button image with alternate text.
Note: The CGI %EDITCELL{ }%=variable cannot be used by itself; place an =%EDITTABLE{ }%=variable at the beginning of a table where you want to use =%EDITCELL{ }% variables.
CGI %EDITTABLE{ format="| row, -1 | text, 20, init | select, 1, one, two, three, four | radio, 3,:-),:-I,:-( | label, 0, %SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%
| Nr | Text field | Drop down | Mood | Timestamp |
|---|---|---|---|---|
| 1 | |
26 Jun 2002 12:30 | ||
| 2 | |
27 Jun 2002 12:40 |
| You type: | You get: | Table in edit mode: |
|---|---|---|
%TABLE{"headerrows="1"}%
%EDITTABLE{ format="| label | text, 40 |" changerows="off" }%
|*Key*|*Value*|
| Name: | John Smith |
| Gender: | M %EDITCELL{select, 1, , F, M}% |
| DOB: | 1999/12/31 %EDITCELL{date, 10}% |
| City: | New York |
|
|
|
CGI CGI %<plugin>_<setting>%, for example, CGI CGI %EDITTABLEPLUGIN_SHORTDESCRIPTION%
CGI data/debug.txt. Default: CGI 0 CGI javascriptinterface. CGI on, CGI off, CGI add CGI on to show the Quiet Save button, CGI off to hide CGI button text, or specify CGI alternate text, image URL. Note: Texts inside CGI %MAKETEXT{}% are translated into other languages.
CGI | ... ||) and cell justification (e.g. CGI | centered | right |)
CGI %EDITTABLE{}% statements on the same line in the source
CGI select,1,%<nop>X%,%<nop>Y%
CGI CGI EditTablePlugin.zip in your ($TWIKI_ROOT) directory.
CGI viewauth script to authenticate the user. As described in TWikiAccessControl, copy the CGI view script to CGI viewauth (or better, create a symbolic link) and add CGI viewauth to the list of authenticated scripts in the CGI .htaccess file.
CGI configure in your TWiki installation, and enable the plugin in the {Plugins} section.
| Plugin Author: | TWiki:Main/PeterThoeny |
| Copyright: | © 2002-2008, TWiki:Main.PeterThoeny (TWIKI.NET) and TWiki Contributors |
| License: | GPL (GNU General Public License) |
| Plugin Version: | 4.8.4 (03 Aug 2008) |
| Change History: | |
| 03 Aug 2008: | 4.8.4 TWiki 4.2.1 release version |
| 19 Jul 2008: | 4.8.3 Bugfix release |
| 20 Mar 2008: | 4.8: Arthur Clemens: Code refactoring; disabled table sort when editing; removed usage of CGI $percnt to prevent variable expansion (is now done automatically); made Javascript interface aware of headers and footers, and of CGI changerows="off"; improved feedback on row move. |
| 25 Dec 2007: | 4.7.1: Arthur Clemens: Added warning if CGI include parameter topic does not exist. |
| 22 Dec 2007: | 4.7: Arthur Clemens: Changed handling of escaped variables. To escape TWiki variable, use formatting tokens such as CGI $percnt. |
| 16 Dec 2007: | 4.6: Kenneth Lavrsen: The plugin prevents TablePlugin from initsorting the table being edited. This is done by temporarily appending the attribute disableallsort="on" to the TABLE tag of a table being edited. Additionally all header sorting is disabled while editing a table by setting a hidden formfield CGI sort to "off". Disabling sorting while editing is needed now that the EditTablePlugin supports moving rows up and down. |
| 01 Dec 2007: | 4.3: Arthur Clemens: added support for TablePlugin CGI headerrows and CGI footerrows; updated edit button |
| 16 Oct 2007: | 4.2: Arthur Clemens: refactoring, bug fixes. |
| 07 Oct 2007: | 15182: PTh: Added VarEDITTABLE to have it listed in TWikiVariables |
| 15 Mar 2007: | Arthur Clemens: Fixed eating of double newlines; icons for javascript buttons and interface improvements. By default the javascript interface is turned off, set CGI JAVASCRIPTINTERFACE to use it in edit mode. |
| 05 Mar 2007: | Byron Darrah: Added ability to dynamically move and delete rows. |
| 12 Oct 2006: | Item2982 Use default date format from JSCalendarContrib |
| 02 Oct 2006: | Item2884 Check also for access permission in meta data; proper fix to not warn if oneself has a lock on topic |
| 30 Aug 2006: | Item2829 Remove whitespace from select, radio and checkbox items; restored topic lock if $TWiki::Plugins::VERSION < 1.1 |
| 29 Jul 2006: | Item2684 - Quietly ignore topic edit locks on table edit |
| 21 Jan 2006: | TWiki:Main.CrawfordCurrie ported to TWiki-4.0.0, changed to use JSCalendarContrib |
| 16 Sep 2004: | Added radio buttons and checkbox controls; escaped "|" pipe symbol found in input fields to preserve tables |
| 01 Aug 2004: | Fixed bug where edittable did not work if at the end of a topic |
| 07 Apr 2004: | Fixed bug where two tables got updated when you edit and save a table included into a topic containing other edit tables |
| 02 Mar 2004: | Default for CGI %EDITCELL{editbutton}% is EDITBUTTON preference |
| 27 Feb 2004: | Added QUIETSAVE setting and CGI quietsave parameter; image for Edit button |
| 18 Feb 2004: | Doc fixes; allow edit button anywhere in a cell not just at the end of a cell |
| 17 Feb 2004: | Added per cell definition of edit field types with CGI %EDITCELL{}% variable; added CGI headerislabel and CGI editbutton parameters |
| 20 Dec 2003: | Fixed bug where calendar did not work after adding a row (TWiki:Main/PaulineCheung); added all language files of Mishoo DHTML calendar 0.9.5 |
| 13 Dec 2003: | Added CHANGEROWS, JSCALENDARDATEFORMAT, JSCALENDARLANGUAGE, JSCALENDAROPTIONS settings |
| 16 Oct 2003: | small typo fixed (garbled if ---+ header on top) |
| 15 Oct 2003: | new date field type with javascript calendar - CN |
| 14 Oct 2003: | docfix: the documentation page was an old one - CN |
| 13 Oct 2003: | bugfix: %-vars in select were resetted to first on add/del row - CN |
| 18 Sep 2003: | incompatibility: changed default of CGI changerows to CGI on; support for %-vars, Quiet save for saving without notification; all other fixes in Dev topic integrated - CN |
| 08 Nov 2002: | Prevent variable expansion in label text; added escape characters |
| 27 Jun 2002: | New CGI helptopic parameter |
| 26 Jun 2002: | Support for variables in included EDITTABLE parameters; fixed problem with HTML in cells |
| 21 May 2002: | Added fixed label format; new CGI changerows="add" parameter |
| 27 Apr 2002: | Fixed bug where text after a double quote in a cell disappeared |
| 18 Apr 2002: | Fixed bug where table was breaking when pasting multiple lines into an edit field using Netscape on Unix |
| 08 Apr 2002: | Check for change permission and edit lock of topic |
| 05 Apr 2002: | Initial version |
| Dependencies: | None |
| Perl Version: | 5.0 |
| TWiki:Plugins/Benchmark: | GoodStyle 98%, FormattedSearch 98%, EditTablePlugin 95% |
| Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/EditTablePlugin |
| Feedback: | http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginDev |
| Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginAppraisal |