Set value of editor I did not create

We run a web application that makes used of the CodeMirror editor. In additional, they application allows for the creation of plugins to extent functionality. One plugin we make use of sets the value of an editor when a select list is changed. The problem is that this plugin actually disables the CodeMirror editor and just re-displays the <textarea>. I can disable this with no problems, so that the CodeMirror editor stays active. I cannot figure out how to get the editor, through.

  • $('.CodeMirror', $(subform)); returns a valid element
  • $('.CodeMirror', $(subform)).CodeMirror.setValue('VALUE') throws an error.
  • $('.CodeMirror', $(subform)).CodeMirror is undefined

Any advice how to get the editor and set it’s value would be greatly appreciated.