简体   繁体   English

如何创建一个ckeditor到jqueryui对话框?

[英]how to create a ckeditor into a jqueryui dialog?

I'm trying to use a CKEDITOR instance into a jqueryUI dialog. 我试图在CKUI对话框中使用CKEDITOR实例。

$('[name=dialog]').dialog();
$('[name=content]','[name=dialog]').ckeditor();

It works fine until i want to use the dialogs from the editor (fe dialog to set an URL, dialog to create a table) 在我要使用编辑器中的对话框之前,它工作正常(例如,对话框用于设置URL,对话框用于创建表)

it's like i can't click on that dialog.. 就像我无法单击该对话框。

i was checking for the z-index (i think that is the problem) but nothing, it is the highest level and nothing, i can not use those dialogs. 我正在检查z索引(我认为这是问题所在),但是什么也没有,它是最高级别,什么也没有,我不能使用那些对话框。

Anybody knows why is this for? 有人知道这是为什么吗?

I know this post is a little late, but maybe it'll help the next guy. 我知道这篇文章有点晚了,但也许会对下一个家伙有所帮助。 To create a ckeditor instance in a dialog, you have to load the dialog first and then create ckeditor like this: 要在对话框中创建ckeditor实例,您必须先加载对话框,然后再创建ckeditor,如下所示:

$("#mydialog").dialog({
    open: function() {
         $("#mytextarea").ckeditor(); //LOAD IT HERE
    },
    close: function() {
       //you might want to destroy the instance once the dialog closes 
       //to keep things clean
       CKEDITOR.instances["mytextarea"].destroy();
    },
    autoOpen: true, ... more options
});

Hope this helps. 希望这可以帮助。

Its easy, just the next code ( sorry for the formatting, but I'm replying using my mobile ) 它很简单,仅是下一个代码(格式很抱歉,但是我在用手机回复)

$("<div><textarea id='foo'></textarea></div>").dialog({});
CKEDITOR.replace("foo");

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

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