configureAsSimpletableTableElements

How to get configureAsSimpletableTableElements

import configureAsSimpletableTableElements from 'fontoxml-dita/src/configureAsSimpletableTableElements.js'

Type: Function

Configure the given set of elements as a DITA simpletable. More configuration options for the configureAsSimpletableTableElements function will be added at a later point in time.

For example:

configureAsSimpletableTableElements(sxModule, {
    priority: 5, // Optional
    stentry: {
        defaultTextContainer: 'p' // Optional
    },
    table: {
        tableFilterSelector: 'not(@conref)'
    }
});

configureProperties(sxModule, 'self::simpletable', {
    contextualOperations: [
        { name: 'table-contextual-delete' }
    ],
    markupLabel: 'simple table',
    tabNavigationItemSelectorOrNodeSpec: 'self::entry'
});

As simple tables do not use elements to define columns, the columnBefore widget area is not supported.

Example usage for the table widgets:

configureAsSimpletableTableElements(sxModule, {
	table: {
		tableFilterSelector: 'not(@conref)'
	},
	stentry: {
		defaultTextContainer: 'p'
	},
	rowBefore: [
		createIconWidget('dot-circle-o', {
			clickOperation: 'do-nothing'
		})
	],
     columnBefore: [
         createIconWidget('clock-o', {
             clickOperation: 'lcTime-value-edit',
             tooltipContent: 'Click here to edit the duration'
         })
     ],
	showInsertionWidget: true,
	showHighlightingWidget: true
});

Arguments

# Name Type Description
1. sxModule SxModule
2. options Object
  Members

Members

Name Type Description
[columnBefore] Array<Widget> | Null

To add column icon widgets by using createIconWidget. Column widgets are linked to the cell elements in the first row. Any widget can be added but only icon widget is supported.

[priority] Number

Selector priority for all elements configured by this function

[rowBefore] Array<Widget> | Null

To add row icon widgets by using createIconWidget. Row widgets are linked to the row elements of the table. Any widget can be added but only icon widget is supported.

[showHighlightingWidget] Boolean

To add highlighting bars which highlight columns and rows, and provide operations popover, default false.

[showInsertionWidget] Boolean

To add insertion buttons which insert a column or a row to a specific place, default false.

[stentry] Object

Configuration options for the stentry element

  Members

Members

Name Type Description
[defaultTextContainer] String

The default text container for the stentry element

[table] Object

Configuration for the whole table

  Members

Members

Name Type Description
[tableFilterSelector] XPathTest

Additional override for which simple table elements should be regarded as tables. This can be used to configure conreffed tables as not being tables.

useDefaultContextMenu Boolean

Whether or not to use a preconfigured context menu for elements within the table


  Default value
true
Was this page helpful?