A
A
Anna S.2021-12-15 12:21:59
CKEditor
Anna S., 2021-12-15 12:21:59

CKEditor4 how to set styles for my plugin and pass a parameter to command?

Good afternoon!
I am writing my own plugin for inserting information from a list of possible options.
There were 2 questions:
1 - I create a data object for output in a loop:

var items = {};
        for(var i = 0; i < fields.length; i++){
            items[i] = {
                label: fields[i][0],
                group: 'addfield_group',
                order: i,
                command: 'qwerty',
            };
        }

and then display it when opening the menu
if (editor.addMenuItems) {
            editor.addMenuItems( items );
        }

I need to somehow pass in the command 'qwerty' the identifier of the item that was clicked. How to do it?

2. When opening a menu with items, the lines go to the full width of the screen, how to limit them in styles? While I'm trying to select an element on the page, the items window is automatically closed. Trying to add width/height to the items code does nothing.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question