How to disable writing into an integrated text editor?

Hi

I was taking reference from this two links below to make text editor using code mirror. The links are as follows:
https://docs.webix.com/desktop__text_editors.html
and
https://snippet.webix.com/ldv02xb9

However, due to some reasons, I need to disable (make readonly) writing to this editor. I tried below two options but they are not working:

readOnly:“nocursor”
readOnly: true

How can I make the editor readOnly (i.e disable typing) with only some fixed and template text.

Snippet: https://snippet.webix.com/jy8cckj7

Thanks

try this

$$("editor").getEditor(true).then(function(editor){
  editor.options.readOnly = true;
});

Hi intrgal

This is working here https://snippet.webix.com/hxrw8svr

In my application, all the code is inside webix.ready block. The code that you pasted is not working if I write inside webix.ready block.
Not sure what wrong is going on.

Thanks,

https://snippet.webix.com/9osbfna4

This seems to work. The getEditor function should also be inside ready function as it will return a undefined for the mirror_notepad object if defined elsewhere. I think that is why it is not working for you right now.