DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:jsontable

JSON Table plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" yes
  • 2022-07-31 "Igor" yes
  • 2020-07-29 "Hogfather" yes

plugin Integrate Excel like spreadsheet into json plugin

Last updated on
2023-10-26
Provides
Syntax, Action
Repository
Source
Conflicts with
edittable
Requires
json

Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Install also JSON plugin.

Description

JSON Table Plugin is based on JSON plugin. It adds a table to the page. Table can be edited like spreadsheet and data can be saved inside a page without page reload. Table is based on Handsontable. Data for the table is defined by JSON plugin. Table has many options, for example: column header, data validator, select.

<jsontable id=cars path=cars options='{"colHeaders": ["Year", "Car", "Count"]}'>[
    ["2017", "Honda", 10],
    ["2018", "Toyota", 20],
    ["2019", "Nissan", 30]
]</jsontable>

Here is a DokuWiki JSON Demo Server with JSON database integrated into DokuWiki. Also source code of this plugin contains demo. You can copy the contents of the demo files into your DokuWiki and experiment with them.

Support

For issues or just questions use Issues on Gitlab. Please don't email directly.

Usage

Syntax is similar as in JSON Data Plugin:
<jsontable attributes > inline_json </jsontable>

It is parsed with same parser as <json> elements, so rules for attributes and inline_json are the same. It loads JSON data the same way, from src attribute and from inline_json. It only has some extra attributes and additional tab for the table. Data source for the table is JSON data defined by the <jsontable> element (see attributes 'path', 'src', 'src_ext' and inline_json).

Attribute 'options'

It must be a valid JSON string inside single quotes. Special characters inside string, like ', < or >, can be passed by &apos;, &lt; or &gt;. Options are directly passed into Handsontable options. All Handsontable options are freely configurable, except data source. Options may also be defined inside JSON database. In this case they can be referenced from there, for example options=%$path.to.table_options%.

Attribute 'save'

It specifies, how data are stored into inline_data. If set to all, then all 'combined_data' will be stored into 'inline_data' on table change. Otherwise only the difference from 'original data' will be saved. This is the default behavior.

plugin/jsontable.txt · Last modified: 2023-12-27 19:46 by Aleksandr

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki