带有 jQuery UI 对话框、拼写检查和按钮在第二次单击时不起作用的 CKEditor
CKEditor with jQuery UI Dialog, spell check and buttons not working on second click
我正在使用 CKEditor 4 to turn a <textarea>
into a WYSIWYG editor inside a jQuery UI Dialog。
我有 3 个问题,我认为它们是相关的:
- SCAYT 功能无效。您可以单击拼写检查下拉菜单并单击 "Enable SCAYT",但它不会执行任何操作。
- 如果您点击 "Enable SCAYT" 选项两次,您将收到 JS 错误,指出 SCAYT 版本比应用程序版本更新,并且 SCAYT 未定义:
- 如果您关闭对话框并尝试重新打开它,JS 错误会重复出现并且大多数其他按钮停止工作:
任何帮助都会很棒。这是我正在使用的代码:
function OpenDialog(modalID, w, h) {
$("#" + modalID).css("display", "block");
$("#" + modalID).dialog({
draggable: false,
height: h,
width: w,
resizable: false,
modal: true,
appendTo: "form",
buttons: [
{
text: 'Save',
class: "saveicon",
click: function () {
//Save Stuff
}
}
]
}).bind('dialogclose', function (event, ui) {
//toggles the editor controls
editor = CKEDITOR.instances['<%=txtEditor.ClientID %>'];
if (editor) {
editor.updateElement();
editor.destroy();
}
});
$(".saveicon").prepend('<span class="glyphicon glyphicon-floppy-disk"></span> ');
}
我的问题是多个问题的组合,都在我这边:
按钮变灰是由于缓存问题。我清除了缓存,问题就解决了。
SCAYT 问题是因为我公司的防火墙阻止了对 SCAYT 网络服务的调用。
我正在使用 CKEditor 4 to turn a <textarea>
into a WYSIWYG editor inside a jQuery UI Dialog。
我有 3 个问题,我认为它们是相关的:
- SCAYT 功能无效。您可以单击拼写检查下拉菜单并单击 "Enable SCAYT",但它不会执行任何操作。
- 如果您点击 "Enable SCAYT" 选项两次,您将收到 JS 错误,指出 SCAYT 版本比应用程序版本更新,并且 SCAYT 未定义:
- 如果您关闭对话框并尝试重新打开它,JS 错误会重复出现并且大多数其他按钮停止工作:
任何帮助都会很棒。这是我正在使用的代码:
function OpenDialog(modalID, w, h) {
$("#" + modalID).css("display", "block");
$("#" + modalID).dialog({
draggable: false,
height: h,
width: w,
resizable: false,
modal: true,
appendTo: "form",
buttons: [
{
text: 'Save',
class: "saveicon",
click: function () {
//Save Stuff
}
}
]
}).bind('dialogclose', function (event, ui) {
//toggles the editor controls
editor = CKEDITOR.instances['<%=txtEditor.ClientID %>'];
if (editor) {
editor.updateElement();
editor.destroy();
}
});
$(".saveicon").prepend('<span class="glyphicon glyphicon-floppy-disk"></span> ');
}
我的问题是多个问题的组合,都在我这边:
按钮变灰是由于缓存问题。我清除了缓存,问题就解决了。
SCAYT 问题是因为我公司的防火墙阻止了对 SCAYT 网络服务的调用。