Load grid row data into CodeMirror - get CodeMirror reference

﹥>﹥吖頭↗ 提交于 2019-12-12 03:59:36

问题


I am building a small extjs 5.1 app for personal use, designed to save examples of functions / methods used in my extjs apps.

I've given the most important steps with the help of Navaneeth-Kesavan and Tarabass in this Post

Now I'm struggling to load in CodeMirror editor the grid row data.

After several unsuccessful attempts, I am trying to load the data into a hidden textarea and then get value of this textarea and paste the value (setValue) in CodeMirror.

However, I am not able to get the CodeMirror reference.

I would appreciate suggestions to fix this.

By the way, what better way to do this?

MiFiddle


回答1:


CodeMirror element can be found as sibling of the textarea element. You can get reference to it by using the following code:

var codeMirrorInstance = textAreaComponent.getEl( ).query('.CodeMirror')[0].CodeMirror; 

Please refer below fiddle which I created by editing yours.

https://fiddle.sencha.com/#fiddle/tee



来源:https://stackoverflow.com/questions/32423702/load-grid-row-data-into-codemirror-get-codemirror-reference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!