0
votes

I'm using a modified version of the CKEditor, and I have defined a custom combo element called 'elements', which is filled dynamically if conditions are met.

There is the default state, where the element is empty (no options). In this situation, I want the element disabled, not removed. It should be visible, but greyed out, so the user knows it exists, but at this time there is no selection.

I tried a couple of jQuery commands, but with no success.

This is the element (basically a copy of one of the combo plugins):

enter image description here

So, my question is how to get the element name and disable the whole combo box? Thanks in advance.

1
If you create this feature (plugin) in CKEditor then you should use / modify logic inside this plugin. (probably createPanel function) - Alex Kudryashev

1 Answers

0
votes

That combo is a "command" for CKEditor. And you need to change its state, using the "setState" method from command class (http://docs.ckeditor.com/#!/api/CKEDITOR.command).

You'll need to pass as argument any of three possible states:

  • CKEDITOR.TRISTATE_DISABLED
  • CKEDITOR.TRISTATE_OFF
  • CKEDITOR.TRISTATE_ON

http://docs.ckeditor.com/#!/api/CKEDITOR

Regards