close

Filter

loading table of contents...

Studio Developer Manual / Version 2207

Table Of Contents

9.6.5.2 Adding table cell merge and split commands

There are predefined commands for merging and splitting of table cells that can easily be made available in the richtext toolbar. To do so, use the AddItemsPlugin as in the following example and keep in mind the restrictions in this warning.

Config(RichTextPropertyField, {
  plugins: [
    Config(AddItemsPlugin, {
      recursive: true,
      items: [
        /* the mandatory ckEditorValueExpression is set by default in RichTextPropertyField */
        Config(Separator),
        Config(RichTextMenuItem, {
          itemId: RichTextPropertyField.CELL_MERGE_ITEM_ID,
          commandName: RichTextAction.COMMAND_CELL_MERGE,
        }),
        Config(RichTextMenuItem, {
          itemId: RichTextPropertyField.CELL_MERGE_RIGHT_ITEM_ID,
          commandName: RichTextAction.COMMAND_CELL_MERGE_RIGHT,
        }),
        Config(RichTextMenuItem, {
          itemId: RichTextPropertyField.CELL_MERGE_DOWN_ITEM_ID,
          commandName: RichTextAction.COMMAND_CELL_MERGE_DOWN,
        }),
        Config(RichTextMenuItem, {
          itemId: RichTextPropertyField.CELL_VERTICAL_SPLIT_ITEM_ID,
          commandName: RichTextAction.COMMAND_CELL_VERTICAL_SPLIT,
        }),
        Config(RichTextMenuItem, {
          itemId: RichTextPropertyField.CELL_HORIZONTAL_SPLIT_ITEM_ID,
          commandName: RichTextAction.COMMAND_CELL_HORIZONTAL_SPLIT,
        }),
      ],
      after: [
        Config(Component, { itemId: RichTextPropertyField.TABLE_REMOVE_ITEM_ID }),
      ],
    }),
  ],
}),

Example 9.32. Adding table cell merge and split commands


Please note that the RichTextMenuItem has a mandatory ckEditorValueExpression config. This config can only be omitted here, because the RichTextPropertyField's menu automatically adds it to all its menu items.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.