Difference: EditTablePlugin (13 vs. 14)

Revision 142007-10-07 - TWikiContributor

Line: 1 to 1
 

Edit Table Plugin

Changed:
<
<
This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an [ Edit table ] button if preceeded by an %EDITTABLE{...}% variable. Each column can be a text field, a drop down box, a date field, etc. Multiple tables per topic are editable, but only one at a time can be edited.
>
>
Edit TWiki tables in place, using edit fields and drop down boxes, without having to edit the complete topic.

Simply add an [ Edit table ] button to an existing table by writing %EDITTABLE{}% directly above the table. This can be added to tables that are formatted with TablePlugin: add the EDITTABLE variable just above or below the TABLE tag. It can also be used without any 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.

 

Per Table Settings

Changed:
<
<
Add a %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:
>
>
Add a %EDITTABLE{...}% variable just before an existing table to make it editable, or add the variable anywhere in a topic to start a new table.

  • Supported attributes:
    Attribute Comment Default
    header Specify the header format of a new table like "|*Food*|*Drink*|". Useful to start a table with only a button (no header)
    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):
      | text, <size>, <initial value> |
    • Textarea input field:
      | textarea, <rows>x<columns>, <initial value> |
    • Drop down box:
      | select, <size>, <option 1>, <option 2>, etc* |
      * only one item can be selected
    • Radio buttons:
      | radio, <size*>, <option 1>, <option 2>, etc |
      * size indicates the number of buttons per line in edit mode
    • Checkboxes:
      | checkbox, <size*>, <option 1>, <option 2>, etc |
      * size indicates the number of checkboxes per line in edit mode
    • Fixed label:
      | label, 0, <label text> |
    • Row number:
      | row, <offset> |
    • Date:
      | date, <size>, <initial value>, <DHTML date format*> |
      * see Date Field Type
    "text, 16"
    for all cells
    changerows Rows can be added and removed if "on"
    Rows can be added but not removed if "add"
    Rows cannot be added or removed if "off"
    CHANGEROWS
    plugin setting
    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 %STOPINCLUDE% variables can be used in the topic to specify what is shown. (no help text)
    headerislabel Table header cells are read-only (labels) if "on"; header cells can be edited if "off" or "0" "on"
    editbutton Set edit button text, e.g. "Edit this table"; set button image with alt text, e.g. "Edit table, %PUBURL%/%SYSTEMWEB%/TWikiDocGraphics/edittopic.gif"; hide edit button at the end of the table with "hide" (Note: Button is automatically hidden if an edit button is present in a cell) EDITBUTTON
    plugin setting
    buttonrow Set to top to put the edit buttons above the table. bottom
    javascriptinterface Use javascript to directly move and delete row without page refresh. Enable with "on", disable with "off". JAVASCRIPTINTERFACE
    plugin setting
    redirectto Set up a return page after saving changes. e.g By setting redirectto="%BASEPAGE%", you can return to base page if your editable table is included by another page. (none)

Using TWiki Variables in the Format Parameter

TWiki variables like %Y% in <initial value> (of text input field) and <label text> (of fixed label) will get expanded when a new row is added.

This is useful to write variables like dates into the table.

For example:
%EDITTABLE{ format="| label, 0, %SERVERTIME{"$day $mon $year $hour:$min"}% |" }%
... will get expanded to 28 Mar 2024 15:55 when the new row is created.

To prevent variable expansion: escape the format variable with formatting tokens (particularly $percnt).

For example:
%EDITTABLE{ format="| text, 20, $percntY$percnt |" }%
... will create a new row with $percntY$percnt. In view mode this is temporarily translated to %Y% and subsequent rendered as DONE.
 
Deleted:
<
<
Parameter Comment Default
header Specify the header format of a new table like "|*Food*|*Drink*|". Useful to start a table with only a button (no header)
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):
  | text, <size>, <initial value> |
• Textarea input field:
  | textarea, <rows>x<columns>, <initial value> |
• Drop down box:
  | select, <size>, <option 1>, <option 2>, etc* |
  * only one item can be selected
• Radio buttons:
  | radio, <size*>, <option 1>, <option 2>, etc |
  * size indicates the number of buttons per line in edit mode
• Checkboxes:
  | checkbox, <size*>, <option 1>, <option 2>, etc |
  * size indicates the number of checkboxes per line in edit mode
• Fixed label:
  | label, 0, <label text> |
• Row number:
  | row, <offset> |
• Date:
  | date, <size>, <initial value>, <DHTML date format> |
  * see Mishoo documentation for more infos about the DHTML date format
"text, 16"
for all cells
changerows Rows can be added and removed if "on";
Rows can be added but not removed if "add"
CHANGEROWS
Plugin setting
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 %STOPINCLUDE% variables can be used in the topic to specify what is shown. (no help text)
headerislabel Table header cells are read-only (labels) if "on"; header cells can be edited if "off" or "0" "on"
editbutton Set edit button text, e.g. "Edit this table"; set button image with alt text, e.g. "Edit table, %PUBURL%/%TWIKIWEB%/TWikiDocGraphics/edittopic.gif"; hide edit button at the end of the table with "hide" (Note: Button is automatically hidden if an edit button is present in a cell) EDITBUTTON
Plugin setting

Initial Values

By default, variables in <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:
<-- -->
Sorted ascending
$dollar Dollar sign ($)
$quot Double quote ("). Alternatively write \" to escape it
$nop or $nop() Is a "no operation"
$percnt Percent sign (%)
 
Added:
>
>
 

Date Field Type

Changed:
<
<
Edit Table Calendar Example The 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, see also TWiki:Codev/JavaScriptDatePickerForForm
>
>
Edit Table Calendar Example

The 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.

 

Per Cell Settings

Line: 46 to 60
 
  • In page view mode:
Changed:
<
<
    • - turn the table into edit mode
>
>
    • - turn the table into edit mode
 
  • In edit mode:
Changed:
<
<
    • - save your changes
    • - save your changes without alerting subscribed WebNotify users
    • - add row to the table (if enabled)
    • - remove last row from the table (if enabled)
    • - cancel without saving and release edit lock
>
>
    • - save your changes
    • - save your changes without alerting subscribed WebNotify users
    • - add row to the table (if enabled)
    • - remove last row from the table (if enabled)
    • - cancel without saving and release edit lock
    • - Move a row by clicking this button next to the row to be moved, then at a destination.
    • - Deletes the row next to this button.
 

Examples

Line: 67 to 84
  If this plugin is installed you will see an [ Edit table ] button above; if you were to click on it (please don't, use TWiki:Sandbox.EditTablePluginTesting for testing) you get this form:
Changed:
<
<
Nr Text field Drop down Mood Timestamp
1 smile indifferent frown 26 Jun 2002 12:30
2 smile indifferent frown 27 Jun 2002 12:40
(demo only, these buttons do not work)
>
>

Nr Text field Drop down Mood Timestamp
1 smile indifferent frown 26 Jun 2002 12:30
2 smile indifferent frown 27 Jun 2002 12:40
<-- /editTable -->
  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.
Changed:
<
<
>
>
 You type:
Changed:
<
<
%EDITTABLE{ format="| label | text, 40 |" }%

>
>
You get: Table in edit mode:
%EDITTABLE{ format="| label | text, 40 |" changerows="off" }%
 
Key Value
Name: John Smith
Changed:
<
<
Gender: M %EDITCELL{select, 1, , F, M}%
DOB: 1999/12/31 %EDITCELL{date, 10}%
>
>
Gender: M %EDITCELL{select, 1, , F, M}%
DOB: 1999/12/31 %EDITCELL{date, 10}%
 
City: New York
Changed:
<
<
Screenshot: EDITCELL Example in view mode Screenshot in edit mode: EDITCELL Example in edit mode
>
>
EDITCELL Example in view mode EDITCELL Example in edit mode
 

Plugin Settings

Line: 111 to 164
 
  • Set DEBUG to 1 to get debug messages in data/debug.txt. Default: 0
    • Set DEBUG = 0
Added:
>
>
  • Set JAVASCRIPTINTERFACE to 1 to be able to directly move and delete row without page refresh.
    • Set JAVASCRIPTINTERFACE = 1

 
  • Default for change rows flag: on, off, add
    • Set CHANGEROWS = on

  • Default flag for quiet save option: on to show the Quiet Save button, off to hide
    • Set QUIETSAVE = on
Changed:
<
<
  • Default edit button: Specify button text, or specify alternate text, image URL
    • #Set EDITBUTTON = Edit table
    • Set EDITBUTTON = Edit this table, edittable.gif
>
>
  • Default edit button: Specify button text, or specify alternate text, image URL. Note: Texts inside %MAKETEXT{}% are translated into other languages.
    • #Set EDIT_BUTTON = Edit table
    • Set EDIT_BUTTON = Edit this table, edittable.gif
    • Set SAVE_BUTTON = Save table
    • Set QUIET_SAVE_BUTTON = Quiet save
    • Set ADD_ROW_BUTTON = Add row
    • Set DELETE_LAST_ROW_BUTTON = Delete last row
    • Set CANCEL_BUTTON = Cancel

  • Default help texts
    • Set INCLUDED_TOPIC_DOES_NOT_EXIST = Warning: 'include' topic does not exist!
  Note: The Plugin uses base settings like date format, language and style from the JSCalendarContrib.
Line: 132 to 196
 
  • You can include %-vars now in select values, by quoting them with <nop>, as in %<nop>X% for %X%, say for instance:
    select,1,%<nop>X%,%<nop>Y%
Deleted:
<
<

Plugin Installation Instructions

 
Changed:
<
<
Note: You do not need to install anything on the browser to use this Plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
>
>

Installation Instructions

 
  • Download the ZIP file from the Plugin web (see below)
Changed:
<
<
  • Unzip 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
>
>
  • Unzip EditTablePlugin.zip in your ($TWIKI_ROOT) directory.
  • Alternatively,
    • Manually resolve the dependencies listed below. None
 
  • The Plugin depends on the 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.
Deleted:
<
<
  • The Mishoo DHTML calendar 0.9.5 is preinstalled and should work without any configuration. If you wish to use another language, specify the in the Plugin settings, or create a new language files, attach it to the Plugin topic, and change the Plugin settings
 
  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
  • Test if the Plugin is correctly installed:
    • Check above example if there is an [ Edit table ] button below the table in above example
Line: 158 to 214
 

License

  • The Edit Table Plugin is released under the GPL
Deleted:
<
<
  • The Mishoo DHTML calendar bundled with this Plugin was created by Mihai Bazon and is released under the LGPL -- thanks Mihai for the great tool smile
 

Plugin Info

Changed:
<
<
Plugin Author: Peter Thoeny
Copyright: © 2002-2006, TWiki:Main.PeterThoeny
>
>
Plugin Author: TWiki:Main/PeterThoeny
Copyright: © 2002-2007, TWiki:Main.PeterThoeny (TWIKI.NET) and TWiki Contributors
 
License: GPL (GNU General Public License)
Changed:
<
<
Plugin Version: 12327
>
>
Plugin Version: 4.7.10 (08 Jan 2008)
 
Change History:
<-- specify latest version first -->
 
Added:
>
>
25 Dec 2007: 4.7.1: Arthur Clemens: Added warning if 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 $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 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 headerrows and 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 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
Changed:
<
<
16 Sep 2004: Added radio buttons and checkbox controls; escaped "|" pipe symbol found in input fields to preserve tables
>
>
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
Line: 202 to 265
 
Feedback: http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/EditTablePluginAppraisal
Changed:
<
<
Related Topics: TWikiPreferences, TWikiPlugins
>
>
Related Topics: VarEDITTABLE, TWikiPreferences, TWikiPlugins
 
Changed:
<
<
-- TWiki:Main/PeterThoeny - 02 Oct 2006
>
>
-- TWiki:Main/PeterThoeny - 07 Oct 2007
 
Changed:
<
<
META FILEATTACHMENT attr="h" comment="" date="1071283396" name="EditTablePluginCalendarExample.gif" path="EditTablePluginCalendarExample.gif" size="7823" user="PeterThoeny" version="1.1"
META FILEATTACHMENT attr="h" comment="Screenshot" date="1077050633" name="ScreenshotEditCell1.gif" path="ScreenshotEditCell1.gif" size="2017" user="PeterThoeny" version="1.1"
META FILEATTACHMENT attr="h" comment="Screenshot" date="1077050702" name="ScreenshotEditCell2.gif" path="ScreenshotEditCell2.gif" size="3199" user="PeterThoeny" version="1.1"
META FILEATTACHMENT attr="h" comment="Component of Mishoo DHTML calendar" date="1077813483" name="img.gif" path="img.gif" size="145" user="PeterThoeny" version="1.1"
META FILEATTACHMENT attr="h" comment="Component of Mishoo DHTML calendar" date="1077813470" name="menuarrow.gif" path="menuarrow.gif" size="68" user="PeterThoeny" version="1.1"
META FILEATTACHMENT attr="h" comment="Edit table image button" date="1077933805" name="edittable.gif" path="edittable.gif" size="298" user="PeterThoeny" version="1.1"
>
>
META FILEATTACHMENT attr="h" comment="" date="1071283396" name="EditTablePluginCalendarExample.gif" path="EditTablePluginCalendarExample.gif" size="7823" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Screenshot" date="1077050633" name="ScreenshotEditCell1.gif" path="ScreenshotEditCell1.gif" size="2017" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Screenshot" date="1077050702" name="ScreenshotEditCell2.gif" path="ScreenshotEditCell2.gif" size="3199" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Component of Mishoo DHTML calendar" date="1077813483" name="img.gif" path="img.gif" size="145" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Component of Mishoo DHTML calendar" date="1077813470" name="menuarrow.gif" path="menuarrow.gif" size="68" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Edit table image button" date="1077933805" name="edittable.gif" path="edittable.gif" size="298" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Javascript button: move row" date="1077933805" name="btn_move.gif" path="btn_move.gif" size="298" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Javascript button: move target (animated)" date="1077933805" name="btn_target.gif" path="btn_target.gif" size="298" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Javascript button: delete row" date="1077933805" name="btn_delete.gif" path="btn_delete.gif" size="298" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Javascript button: delete (disabled)" date="1077933805" name="btn_delete_disabled.gif" path="btn_delete_disabled.gif" size="298" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Plugin Style Sheet" date="1077933805" name="edittable.css" path="edittable.css" size="298" user="TWikiContributor" version="1.1"
META FILEATTACHMENT attr="h" comment="Javascript for table editing without page refresh" date="1077933805" name="edittable.js" path="edittable.js" size="298" user="TWikiContributor" version="1.1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.EditTablePlugin.