Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

CKEditor - Classic - Disabled / Read-only style


Hi,

I am applying Read-only feature into my CKEditor-Classic to disable the editor because CKEditor does not support a built-in disabled feature.



In fact, I expect it has the same style with the other disabled controls in Metronic.
Could you support it or recommend me a workaround for this case?

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi,

You should use CKEditor Online Editor to build your CKEditor version with required features and options and include in Metronic to use it as you wish.

Regards



Hi Sean,
I did and almost everything works as expected except for the style. As you can see on the demo from the link I mentioned above, read-only/disabled editor has the same style with the normal editor which can cause users confused compared to the other disabled fields such as textbox, textarea, select2, ...

Well, I just ask if you have any recommendation for a solution because I think Metronic should have supported a style for it. However, don't worry, I found one for myself

KTUtil.css(editor.ui.view.editable.element, 'background-color', KTUtil.getCssVariableValue('--bs-gray-200'));

It looks more like a workaround than a solution but so far so good.

Thanks for your reply.



Hi,

Yes, your workaround looks good. You can change the style easily using JS and CSS variables. Great solution!

All the best with your project!

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(