将网格行数据加载到CodeMirror中-获取CodeMirror参考 [英] Load grid row data into CodeMirror - get CodeMirror reference

查看:115
本文介绍了将网格行数据加载到CodeMirror中-获取CodeMirror参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个供个人使用的小型extjs 5.1应用程序,旨在保存extjs应用程序中使用的函数/方法的示例。

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

在Navaneeth-Kesavan和Tarabass的帮助下采取的重要步骤帖子

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

现在我正努力在CodeMirror编辑器中加载网格行数据。

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

经过几次失败的尝试后,我试图将数据加载到隐藏的文本区域中,然后获取该文本区域的值并将值(setValue)粘贴到CodeMirror中。

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.

但是,我无法获取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

推荐答案

CodeMirror元素可以是nd作为textarea元素的同级。您可以使用以下代码来引用它:

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

这篇关于将网格行数据加载到CodeMirror中-获取CodeMirror参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆