LaCava Research Wiki

Initiated September 2017

Dynamic Tables Instructions

JLaCava10th January 2020 at 11:15am

All of the macros are in Table Macros, so you should only have to import that tiddler.

Simple Row/Column Tables

Row table:

<<RowTable "row tiddler filter" "field filter">>

Column table:

<<ColumnTable "column tiddler filter" "field filter">>

The two macros ColumnTable and RowTable each take a filter listing tiddlers as input, with an optional second filter listing fields.

The tiddler filter defines which tiddlers are the columns for the ColumnTable macro and the rows for the RowTable macro.

If the second filter is left out, the rows of the ColumnTable macro are defined by the fields in each tiddler returned by the tiddler filter, the columns for theRowTable macro are defined by the fields in the returned tiddlers.

For row tables you can click on a column header and sort the table by that column, for column tables you can click on the row label and sort the columns by that row. Unfortunately sorting column tables by the columns or row tables by the rows is probably going to take some javascript that I don't feel like dealing with right now. It requires sorting the fields of a tiddler by their contents.

Examples: Simpler Table Macros

Table Wizard

The macro <<MakeTableWizard>> will display the table creation tool. It doesn't take any arguments. You set the name of a configuration tiddler that holds the information for a table.

The macro <<DisplayTable ConfigurationTiddler>> will display a table made using the creation tool where ConfiguartionTiddler is the name of the tiddler given in the creation tool.

Enter a configuration tiddler name, each configuration tiddler will be associated with one table. You can make as many as you want.

Put in subcolumns, or not as you will.

Enter a tag that will be on the tiddler named with your dataset, you can create a new data set using the button. Note that if you try to make one with the same name as an existing tiddler it will overwrite the tag field of that tiddler.

Same for columns, subcolumns and rows. Subcolumns per column should be set to be equal to the number of columns you are using.

Row, column and subcolumn names can be any valid tiddler name.

If you check 'Allow Inline Editing' you can click on a cell in the table to edit the contents of that cell. For the moment this is probably the best way to enter data.

Data is stored it tiddlers using the naming convention:

For tables without subcolumns:

$:/Data/(Row Name)/(Column Name)/(Dataset Name)

The value is stored in the field column_data

For tables with subcolumns:

$:/Data/(Row Name)/(Column Name)/(Subcolumn Name)/(Dataset Name)

The value is stored in the field subcolumn_data

Yes, this means that you have a tiddler for each cell in the table. To do this any other way I would have had to drop support for subcolumns and use data tiddlers.