Hello to the wonderful stackoverflow community,
I recently incorporated a Codemirror Editor into my ExtJSProject like this:
addCodeMirrorPanel: function() {
this.getAixmFormarea().add(Ext.widget({
xtype: 'textarea',
fieldLabel: 'AIXM',
autoScroll: true,
name: 'aixm',
id: 'codearea',
width: 800,
height: 300,
resizable: true,
resizeHandles: 's se e',
listeners: {
afterrender: function () {
var textarea = Ext.getCmp('codearea');
var codemirror = CodeMirror.fromTextArea(textarea.inputEl.dom,{
lineNumbers: true,
content: '',
matchBrackets: true,
electricChars:true,
autoClearEmptyLines: true,
extraKeys: {"Enter": "newlineAndIndentContinueComment"}
});
}
}
}));
}
Now, my goal is to access the codemirror editor from a different Controller function, but I'm unsure of the proper method to do so. There doesn't seem to be a getInstance() or getEditorByID() function specified in the codemirror manual, and accessing it from the hidden textfield is proving to be a challenge.