User Tools

Site Tools


jsontable:jsontable_plugin

JSON Table plugin

—- plugin —- description: Integrate Excel like spreadsheet into json plugin. author : Janez Paternoster email : janez.paternoster@siol.net type : syntax, action lastupdate : 2023-10-26 compatible : Hogfather,Igor,Jack Jackrum depends : json conflicts : edittable similar : json, jsoneditor, jsongendoc, struct, edittable tags : data, json, database, editing, tables

downloadurl: https://gitlab.com/dokuwiki-json/jsontable/-/archive/master/json-master.zip bugtracker : https://gitlab.com/dokuwiki-json/jsontable/-/issues sourcerepo : https://gitlab.com/dokuwiki-json/jsontable donationurl: https://paypal.me/jnz022

screenshot_img: https://gitlab.com/dokuwiki-json/jsontable/-/raw/master/demo/screenshot.png


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.

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.

jsontable/jsontable_plugin.txt · Last modified: 2023/10/27 01:05 by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki