configureAsTeiTableElements

Type: Function

How to get configureAsTeiTableElements?

JavaScript

import configureAsTeiTableElements from 'fontoxml-table-flow-tei/src/configureAsTeiTableElements.js'

Configure TEI tables.

Check our guide for more information on table widgets. Example usage for the table widgets:

Other

configureAsTeiTableElements(sxModule, {
	table: {
		namespaceURI: 'http://www.tei-c.org/ns/1.0'
	},
	cell: {
		defaultTextContainer: 'p'
	},
	row: {
		headerAttribute: {
			name: 'role',
			value: 'label'
		}
	},
	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,
	showSelectionWidget: true,
	columnWidgetMenuOperations: [
		{ contents: [{ name: 'column-delete-at-index' }] }
	],
	rowWidgetMenuOperations: [
		{ contents: [{ name: 'contextual-row-delete' }] }
	]
});

The cell element menu button widgets are added based on the existence of contextual operations on cell level. Make sure that only cell-specific operations are added to the cell widget, so that users are only given options relevant to them. Example on how you can add this element menu on the widget:

Other

configureProperties(sxModule, 'self::cell', {
	contextualOperations: [
		{ name: 'contextual-set-total-cell', hideIn: ['context-menu'] }
	]
});

Tei tables can also be configured to be collapsible. Refer to our guide to learn more.

Arguments

  1. sxModule

    (Required)

    Type: Object

  2. options

    (Optional)

    Type: Object

    Properties