close

Filter

loading table of contents...

Studio Developer Manual / Version 2307

Table Of Contents

10.2.2.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 rich text 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 10.37. Adding table cell merge and split commands


Note

Note

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.