CKEditor实例在一个jQuery对话框中 [英] CKEditor instance in a jQuery dialog
问题描述
我使用jQuery打开一个对话框窗口,其中textarea转换为CKEditor的实例。我使用CKEditor团队提供的jQuery适配器,但是当对话框窗口打开时,我不能与编辑器交互(它被创建,但null被写在内容空间,我不能点击任何东西或修改内容)。
I am using jQuery to open a dialog window with a textarea transformed into an instance of CKEditor. I'm using the jQuery adapter provided by the CKEditor team but when the dialog window opens up I cannot interact with the editor (it's created but "null" is written in the content space and I can't click on anything or modify the content).
此错误报告似乎说,通过使用补丁提供的问题是固定的,但它似乎并不为我工作...
This bug report seems to say that by using a patch provided the issue is fixed but it doesn't seem to be working for me...
这里是我的代码(也许我做了一件事程序错误):
Here's my code (maybe I did something wrong programmatically):
HTML:
<div id="ad_div" title="Analyse documentaire">
<textarea id="ad_content" name="ad_content"></textarea>
</div>
我的包含(一切都包括正确,但也许包括订单问题?):
My includes (Everything is included correctly but maybe it's an including order issue?):
<script type="text/javascript" src="includes/ckeditor/ckeditor.js"></script>
<link rel="stylesheet" type="text/css" href="includes/jquery/css/custom-theme/jquery-ui-1.7.2.custom.css" />
<script type="text/javascript" src="includes/jquery/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="includes/jquery/js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="includes/jquery/plugins/dialog-patch.js"></script>
<script type="text/javascript" src="includes/ckeditor/adapters/jquery.js"></script>
Javascript:
Javascript:
$('#ad_content').ckeditor();
/* snip */
$('#ad_div').dialog(
{
modal: true,
resizable: false,
draggable: false,
position: ['center','center'],
width: 600,
height: 500,
hide: 'slide',
show: 'slide',
closeOnEscape: true,
autoOpen: false
});
$('.analyse_cell').click(function(){
$('#ad_div').dialog('open');
});
编辑:经过一些进一步的测试后,我注意到按下工具栏按钮给我这个错误: p>
After some further testing I noticed that pressing on the toolbar buttons gave me this error:
错误:this.document.getWindow()。$是
未定义源文件:
包含/ ckeditor / ckeditor。 js Line:82
Error: this.document.getWindow().$ is undefined Source File: includes/ckeditor/ckeditor.js Line: 82
推荐答案
由于某种原因,我无法让它工作,设法通过手动实现相同的功能获得相同的效果。
Well for some reason I couldn't get it to work but managed to get the same effect by implementing the same functionality by hand.
这篇关于CKEditor实例在一个jQuery对话框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!