DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:dtable

DTable Plugin

Compatible with DokuWiki

"Ponder Stibbons" "Binky" "Weatherwax" "Angua" "Adora Belle"

plugin Simplify managing DokuWiki tables by adding intuitive GUI

Last updated on
2016-01-22
Provides
Syntax
Repository
Source

Similar to data

Tagged with database, tables

Attention!

Recent version of plugin completly change the way how the plugin works. If you used the plugin formerly, you should read this page before upgrading.

Description

This plugin allows you to use dokuwiki tables using simple ajax GUI. Every table change is saved in dokuwiki as the new page revision so now you don't need to worry when you accidentally change or remove some table rows.(as it was in old dtable). The plugin additionally manages page locks so you don't need to worry that someone can damage your work by using the same page pararelly with you. I've also decided to change all new line chars that appears in textareas to “\\” so now you won't destroy your table when you accidentally insert some new lines to it.

To see what the plugin can do visit this demo page. Login using the user “demo” and the password “demo”. FIXME

To add, edit or remove records just click with the right mouse button on the table. To send the form in the table just doubleclick somwhere in the page. Only logged in users can modify the table.

Known errors

  • Dynamic rowspan doesn't work ideally. Fixed since 2013-09-07
  • There is one bug in dtable when you insert a link or file into the row using form and then try to edit it(it will split your data because currently dtable doesn't distinguish between “|” char being in table context or not). I know about it and it will be fixed in a couple of days. So if you want to edit your data please do it in a standard dokuwiki way but don't forget about my plugin and update immediately when I remove this warning. ;-) 2013-09-20 Fixed since 2013-06-27
  • There is not any validation but I will add this soon. I've decided that it isn't necessary :-)
  • You cannot add more than one table per dokuwiki page. Fixed since 2013-05-25

Future ideas

  • Add dtables to wiki search results. Depraced since dtable uses standard dokuwiki tables
  • Do something to prevent two users from overwriting data when their working with the table at the same time.Achieved since 2013-09-16
  • Add possibility to use normal buttons to manage table instead of popup menu.
  • Add add a mechanism that will prevent the user from breaking the table for ex by mixing colspans and rowspans in prohibited way.

Download and Installation

Download and install the plugin using the Plugin Manager using the URL given above. Refer to Plugins on how to install plugins manually.

Syntax and Usage

Just put your dokuwiki table between <dtable></dtable> tags. Ex.:

<dtable>
^Header 1^Header 2^
|test|table|
</dtable>

Config

  • all_tables - EXPERIMENTAL turn all tables into dtables. I recommend not to use this option now because sometimes it can behaves very strange. But I think that I know how to repair this, so please be patient ;-)

Migrating from old dtable

To migrate from old dtable to the new one, you need to use dtableremote export feature. Read the next section for more information.

I want to use dtable in the old way!

Don't worry. I've decided to keep backwards compability. If you want to use dtable in the old way install dtableremote plugin(remember that this plugin needs standard dtable plugin): https://github.com/hafron/dokuwiki-plugin-dtableremote/archive/master.zip.

It's time to break it ;-) . I highly recomended to upgrade your tables to the new stardard but if you want to still use dtable in the old way, you must use it's older version instead of the current one. You can download this older version from here. Of course you would also need dtableremote.

dtableremote

Download and Installation of dtableremote

WARNING! It is important to put:

~~NOCACHE~~

at the top of the page where you want to add dtable.
It is also important to allow embedded HTML in dokuwiki config manager.

Syntax and Usage of dtableremote

[dtable table_name "row_type(Header name) row_type(Header name)"]

table_name is the name of text file where base will be storage For now there are three row types:

  • text - simple text format
  • file - near the <input> there is a button which allows you to open an “upload file” window This is now depraced since you can use wiki formatting and toolbox in ordinary text file but if you need such a funcionality please let me know.
  • data - at the moment this do nothing but in the futhure this type of filed will allows you to pick a date form js callendar

Header name - name of header can contains all unicode charters

Examples:

[dtable foo "text(Name) text(Last Name) file(Picture) date(Birthday)"]

Added in 7f1fa4705f:
If you want to return from dtable to the standard dokuwiki table(or even exttab2 if you used lists, tables etc. in dtable and you want to preserve them(note: that standard dokuwiki table doesn't support those)). Simply change your dtable syntax to(for standard dokuwiki table):

[export dtable foo "text(Name) text(Last Name) file(Picture) date(Birthday)"]

or(for exttab2(note that you must to install exttab2 plugin and https://github.com/hafron/dokuwiki-plugin-dtableremoteexttabexporter/archive/master.zip first):

[export exttab2 dtable foo "text(Name) text(Last Name) file(Picture) date(Birthday)"]

and save the page. This will cause creation of table at the bottom of the orginal code. Orginal code will also be preserved in the place where it was but will be preceded by two spaces. Just like this:

[dtable foo "text(Name) text(Last Name) file(Picture) date(Birthday)"]

Config of dtableremote

There two config options at the moment:

  • bases_dir - directory where databases files will be storage
  • max_table_width - the max width of the form row

Changelog

2016-01-22:

  • Ready for PHP 7

2015-04-29:

2013-11-28 Version 1.3.1:

  • Some bug fixed.
  • Performance improvements.

2013-11-28 Version 1.3:

  • Huge rebuild of backend. Now plugin should work more reliable and bug #5 is fixed.

2013-11-05 Version 1.2.1:

2013-09-07 Version 1.2:

  • Fused cells should now work correctly
  • Now plugin doesn't let you add an empty row into the table
  • When you remove all data form row during edition it's removed

2013-06-16 Version 1.1:

  • The plugin works on normal dokuwiki tables
  • Page lock is now supported by the plugin.

2013-03-24 Version 1.0beta:

  • Now you can use wiki formatting toolbox in the table
  • Several bugs fixed

2013-02-24 Version 1.0alpha:

  • In this version I completly rebuild the UI. Now it uses jQuery and is fully ajax. I also added the “Insert before” and “Insert after” that allows you to add new records in any place in the table. I've also rebuild the code and make it more clear and easier to read and develop.

2012-05-09 Version 0.1:

  • Initial release.

Licence

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 3 of the License

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Discussion

beautiful plugins! Great!

I would love to see this plugin developed further. There is no fit table-editing tool anymore since Adora-Belle broke edit table. This plugin could help a lot. I do have a suggestion for the interface: instead of a general popup menu simply have the action buttons available per row, or at least a visible button in each row to summon the menu. It would improve usability greatly. Thank you for your commitment! Harald Ronge 2013-04-02

Hi,

I tried using your plugin, I have the following in source

~~NOCACHE~~

[dtable foo "text(Name) Max(num1) text(num2) text(num3) text(num4) "]

I get to see </table> on the top and then the dtable appears right at the bottom of the page. Do you know what I might be missing. - Ritam

Do you remember about allowing embeded html in dokuwiki opitons? I am working currently on the new version of plugin which will be ready in a couple of days where you can use normal dokuwiki tables instead of remote cvs used by the current dtable relase. This will simplify things a little bit. - Szymon Olewniczak (hafron)

Is bug! When editing table,where is many files in cell, form splits this files to many cells.(rolew)2013-06-18 Fixed since 2013-06-27

Bug: when there is no headers line, the Edit menu opens the previous row instead of the row i clicked. And when there is more than one dtable, Edit menu opens a completely different row I believe it's fixed now. Plese check it if you can. 2013-07-23

Trouble with sneaky linebreaks in tables in v2013-09-07

Thanks for your great plugin! Unfortunately, some of my users are managing to break it :-( by inserting links with linebreaks in them. DokuWiki still recognizes the table but dtable gets confused and erases or replaces data. Here's a test case: <code> <dtable> ^ Hi ^ mom ^ | This link has a linebreak | Column 2 | |Line 2|and more| </dtable> </code> I hope you can find a way to outsmart my users? It seems to occur on both Adora Belle and Weatherwax. Thanks, — Rik BlokRik Blok
rikblok

2013/09/11 06:36

Fixed since: 1.3

Thanks for working on it, Szymon! I'm still seeing some bad behaviour in the test case above. For example, if I right click on the link and choose “Insert after” I'm presented with three columns instead of two. Entering anything in the third column causes problems.

Let me know if I can be of any help. — Rik BlokRik Blok
rikblok

2013/11/30 21:17

Try it now. I think that now it should work correctly. — Szymon Olewniczakghi

2013/12/11 09:53

Incompatibility with plugin tabinclude

I just updated to version Weatherwax. The plugin TabInclude goes wrong. Debugging the js I find the following exception. SCRIPT5: Type mismatch. The code that goes in error is the following: {new Image ('lib / plugins / dtable / images / unmerge.png'); I've updated the plugin dtable and tabInclude to the latest version.

Any advice? Thanks, — lanzalelanzale

2013/09/26 13:47

plugin/dtable.txt · Last modified: 2017-02-01 21:14 by solewniczak