2012-08-06 60 views
0

我想在一个jqueryUI对话框中使用一个CKEDITOR实例。如何在jqueryui对话框中创建一个ckeditor?

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

,直到我想使用的对话从编辑器,它工作正常(FE对话框设置的URL,对话框创建表)

这就像我不能该对话框中点击..

我正在检查z-index(我认为这是问题),但没有,它是最高级别,没有任何东西,我不能使用这些对话框。

有人知道这是为什么吗?

回答

1

我知道这个帖子是有点晚了,但也许它会帮下的家伙。 要在对话框中创建一个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 
}); 

希望这有助于。

0

它很容易,只是下一个代码(抱歉的格式,但我用我的手机回复)

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

几个小时后,我发现它的行为中的一个小错误,如果你点击一些ckeditor的按钮,所以我打开了一张票。跟踪它,如果你想避免这个问题,如果有人知道如何解决它http://stackoverflow.com/questions/18084752/ckeditor-over-jquerys-dialog-widget-fails-using-some-toolbars-buttons – 2013-08-06 18:26:44