简体   繁体   English

ACE编辑器未显示JSON数据

[英]ACE Editor is not showing JSON data

I am using ACE Editor on the top of jQuery tab. 我在jQuery标签顶部使用ACE Editor。 I am trying to fetch data of two files from server and trying to show on ACE Editor. 我正在尝试从服务器获取两个文件的数据,并试图显示在ACE Editor上。 I am using AJAX and JSON. 我正在使用AJAX和JSON。 two tabs are being created, things are going right for last file but all the data of files before last are disappeared. 正在创建两个标签,最后一个文件的操作正常,但是最后一个文件之前的所有数据均消失了。 The wondering thing is when I am re-sizing the window suddenly ACE start showing data. 令人奇怪的是,当我重新调整窗口大小时,ACE开始显示数据。 I know the things are very messy and I might be not clear, But can any body give me some clue. 我知道事情很混乱,我可能不清楚,但是任何人都可以给我一些线索。

Before showing data on ACE Editor I checked it using alert() and it is showing the correct data... 在ACE Editor上显示数据之前,我使用alert()对其进行了检查,它显示了正确的数据...

Looks like editor is thinking it is hidden and doesn't draw anything, after showing hidden editor you should call editor.resize() to let it know that size of the container have changed. 看起来编辑器认为它是隐藏的,什么也没画,显示隐藏的编辑器后,应调用editor.resize()使其知道容器的大小已更改。

Btw if you have many tabs, more than 2-3, it is better to use one editor and change sessions via editor.setSession(..) 顺便说一句,如果您有许多标签,超过2-3个,则最好使用一个编辑器并通过editor.setSession(..)更改会话

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM