我正在使用 APEX 4.2.4,并尝试创建一个包含 Rick 文本编辑器 (CKEditor3) 的对话框。
我在某个区域(区域 ID:#notification
)中添加了富文本编辑器字段,并将 style="display:none;"
设置为此区域。然后我有一个按钮,单击该按钮时,它会执行以下 JS 代码并触发模式:
function notification() {
var jqDialog = $('#notification').dialog(
{ modal: true,
autoOpen: true,
width: '500px',
closeOnEscape: true
});
}
单击按钮时,模式会按预期打开,但编辑器的 iframe 为空(无法单击其中并添加内容)。
如果我从模式中删除编辑器并正常地使用页面加载来渲染它,我会看到编辑器并且它可以毫无问题地编辑。但从我隐藏它的那一刻起(使用 display:none;
或 visibility:hidden;
),然后使用模式显示它,它就不再可编辑了.
它无法在 Firefox 27.0.1 和 Chrome 33.0.1750.154 m 中运行,但可以在 IE 10 和 11 中运行。
最佳答案
这很可能是一个错误,如 http://bugs.jqueryui.com/ticket/4727 中所述。 。但对我来说这个解决方案不起作用。由于 apex 的性质,不可能在
标记中的 init ckeditor 文件之后立即放置 jquery-ui-dialog-patch-ckeditor.js 文件。唯一有效的解决方案:在“页面属性”中的“页面加载时执行”区域中写入:
$('#notification').dialog({ modal: true, autoOpen: true, width: 500, closeOnEscape: true, autoOpen: false });
然后,在动态操作中,在按钮的“单击”事件中,您可以重新定义对话框选项并打开对话框:
$('#notification').dialog({ modal: true, autoOpen: true, width: 700, height: 400, closeOnEscape: true, autoOpen: false }); $('#notification').dialog("open");
它适用于所有现代浏览器,包括 IE 10 和 11。
关于jquery - Oracle APEX : Rich Text Editor won't work in jQuery dialog box,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22450403/