%EDITTABLE{...}%
variable. Each column can be a text field, a drop down box or a row number. Multiple tables per topic can be editable, but only one at a time canbe edited.
%<plugin>_<setting>%
, for example, %EDITTABLEPLUGIN_SHORTDESCRIPTION%
data/debug.txt
. Default: 0
on
, off
, add
on
, off
, no
on
to show the Quiet Save button, off
to hide
button text
, or specify alternate text, image URL
calendar-<code>.js
language file: en
, af
, br
, ca
, cs-win
, da
, de
, du
, el
, es
, fr
, hr
, hr-utf8
, hu
, it
, jp
, nl
, no
, pl
, pt
, ro
, ru
, sk
, sp
, sv
, tr
, zh
JSCALENDAR*
settings first in the TWiki Preferences, then in above Plugin settings
%EDITTABLE{...}%
variable just before an existing table to make it editable, or add the variable anywhere in a topic to start a new table. Parameters:
Parameter | Comment | Default | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
header | Enable static header if "on" , e.g. disable editing of the first row;Else specify the header format of a new table like "|*Food*|*Drink*|" .HTML comments can be added in the header like "|*Food* <!--Drink-->|" or . | (no header) | ||||||||||||||||
format | The format of one row when editing the table. A cell can be a text input field, a drop down box, a fixed label, or a row number. Cell definitions:
| "text, 16" for all cells | ||||||||||||||||
changerows | Rows can be added and removed if "on" ;Rows can be added but not removed if "add"=" ;Rows can't be added or removed if "off" ; checkbox not appear if "off" | "on" | ||||||||||||||||
defaultrows | Rows added have the default value defined in format if "on" ;Rows added have the same value as the rows checked if "off" or "no" | "off" | ||||||||||||||||
quietsave | Quiet Save button is shown if "on", hidden if "off" | QUIETSAVE Plugin setting | ||||||||||||||||
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) | ||||||||||||||||
helptopic | Topic name containing help text shown below the table when editing a table. The %STARTINCLUDE% and %STARTINCLUDE% variables can be used in the topic to specify what is shown. | (no help text) |
<initial value>
(of text input field) and <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 if you do not want that:
Text: | To Escape: |
---|---|
$quot | Double quote (" ). Alternatively write \" to escape it |
$percnt | Percent sign (% ) |
$dollar | Dollar sign ($ ) |
$nop or $nop() | Is a "no operation" |
date
field type allows one to choose a date with a popup calendar. Popup calendar works for Netscape 6.0 or better, all other Gecko-based browsers, Internet Explorer 5.0 or better for Windows, Opera 7 and Konqueror 3.1.2. The ...
button is inactive if the browser cannot support the popup calendar. It uses the nice Mishoo DHTML calendar. %EDITCELL{ "type, ..." }%
variable at the end of the cell content. This is useful to override the per column %EDITTABLE{ format="..." }%
settings, or to create tables with key/value rows. All edit field types of the format="..."
parameter are supported. For example, to define a text field, type: | 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 | %EDITCELL{ "editbutton, 1, Edit this table" }% |
to show a button, or | %EDITCELL{ "editbutton, 1, Edit table, Image-URL" }% |
to show a button image with alternate text.
Note: The %EDITCELL{ }%=variable cannot be used by itself; place an =%EDITTABLE{ }%=variable at the beginning of a table where you want to use =%EDITCELL{ }%
variables.
EDITTABLE{ header="on" format="| select, 0, A, B, C | select, 0, 1, 2, 3 | select($1$2), 0, A1 => value1, A1 => value2, A2 => value2, A3 => valuea, B3 => valueb|" changerows="on" }Note: Please do not save this example table! Use your page if you want to try out this Plugin Moreover, this plugin allows the possibility to include the select list of options from a topic text or from a topic field. You may use the syntax shown in the following instance (options read from
JohnSmithEssaisOptionsExample
text topic and from JohnSmithEssaisOptionsExample
topic form field Field:
%EDITTABLE{ header="on" format="| select(none), none => JohnSmithOptionsExample, none => Main.JohnSmithOptionsExample, none => JohnSmithEssaisOptionsExample:Field|" changerows="on" }%
%EDITTABLE{ header="on" 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" }%
Note: Please do not save this example table! Use your page if you want to try out this Plugin
If this plugin is installed you will see an [ Edit table ] button above; if you were to click on it (please don't, use your page for testing) you get this form:
The following example shows a simple table with key/value rows. The default edit field type for the value column is a text field. This is overloaded by a selector for the Gender, and a date picker for the DOB. This is typically used by TWiki applications where new topics with tables are created based on a template topic.
You type:
%EDITTABLE{ format="| label | text, 40 |" }% |*Key*|*Value*| | Name: | John Smith | | Mood: | :-) %EDITCELL{select, 1,:-),:-I,:-( }% | | Gender: | M %EDITCELL{select, 1, , F, M}% | | DOB: | 2021/12/31 %EDITCELL{date, 10}% | | City: | New York | |
Screenshot: |
Screenshot in edit mode: |
| ... ||
) and cell justification (e.g. | centered | right |
)
%ATTACHURL%
get expanded unless they are in a label
%EDITTABLE{}%
statements on the same line in the source
select,1,%<nop>X%,%<nop>Y%
EditTablePlugin.zip
in your twiki installation directory. Content:
File: | Description: |
---|---|
data/TWiki/EditTablePlugin.txt | Plugin topic |
data/TWiki/EditTablePlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/EditTablePlugin.pm | Plugin Perl module |
pub/TWiki/EditTablePlugin/edittable.gif | Edit table button image |
pub/TWiki/EditTablePlugin/*.gif | Screenshots and Mishoo DHTML calendar images |
pub/TWiki/EditTablePlugin/README | Mishoo DHTML calendar README |
pub/TWiki/EditTablePlugin/release-notes.html | Mishoo DHTML calendar release notes |
pub/TWiki/EditTablePlugin/*.js | Mishoo DHTML calendar JavaScript files |
pub/TWiki/EditTablePlugin/calendar-system.css | Mishoo DHTML calendar stylesheet |
viewauth
script to authenticate the user. As described in TWikiAccessControl, copy the view
script to viewauth
(or better, create a symbolic link) and add viewauth
to the list of authenticated scripts in the .htaccess
file.
Plugin Author: | TWiki:Main/PeterThoeny |
Plugin Version: | 16 Sep 2021 |
Change History: | |
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 %EDITCELL{editbutton}% is EDITBUTTON preference |
27 Feb 2004: | Added QUIETSAVE setting and 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 %EDITCELL{}% variable; added headerislabel and 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 changerows to 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 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 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 |
CPAN Dependencies: | none |
Other Dependencies: | Mishoo DHTML calendar (version 0.9.5 preinstalled); TWiki version 01 Feb 2022 or later |
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 |
with the contribution of <br>-- Main.XavierRedon <br>-- Main.LudovicDauchy - 20 Oct 2021 <br>-- Main.CharlesMalafosse - 20 Oct 2021