Javascript 如何在CkEditor 4.4.7中禁用工具栏中的“保存”按钮

Javascript 如何在CkEditor 4.4.7中禁用工具栏中的“保存”按钮,javascript,ckeditor,Javascript,Ckeditor,我正在使用ckeditor 4.7并使用其cdn加载ckeditor。 我想在ckeditor上禁用保存按钮 我尝试过CKEDITOR.instances.test_editor.commands.save.disable();但似乎不起作用 下面是我的代码 <html> <head> <script src="//code.jquery.com/jquery-1.10.2.js"></script>

我正在使用ckeditor 4.7并使用其cdn加载ckeditor。 我想在ckeditor上禁用保存按钮 我尝试过CKEDITOR.instances.test_editor.commands.save.disable();但似乎不起作用

下面是我的代码

<html>
    <head>     
        <script src="//code.jquery.com/jquery-1.10.2.js"></script>
        <script>
            $("#ccfive_test_editor").ready(function () {
                $("#ccfive_test_editor").siblings().hide();
                $.getScript('//cdn.ckeditor.com/4.4.7/full/ckeditor.js', function () {
                    $.getScript('//cdn.ckeditor.com/4.4.7/standard/adapters/jquery.js', function () {
                        $("#ccfive_test_editor").ckeditor();
                        CKEDITOR.config.height = 400;
                        CKEDITOR.instances.ccfive_test_editor.commands.save.disable();  
                    });
                });
            });
        </script>
    </head>
    <body>       
        <form name="ckfrm" id="ckfrm">
            <textarea cols="10" id="ccfive_test_editor" name="ccfive_test_editor" rows="10"></textarea>
        </form>
    </body>
</html>

$(“#ccfive_test_editor”).ready(函数(){
$(“#ccfive_test_editor”).sides().hide();
$.getScript('//cdn.ckeditor.com/4.4.7/full/ckeditor.js',函数(){
$.getScript('//cdn.ckeditor.com/4.4.7/standard/adapters/jquery.js',函数(){
$(“#ccfive_test_editor”).ckeditor();
CKEDITOR.config.height=400;
CKEDITOR.instances.ccfive_test_editor.commands.save.disable();
});
});
});

我不知道你说的“禁用按钮”是什么意思-你想完全删除插件提供的功能吗?你想在代码中需要时手动启用和禁用按钮吗

CKEditor有两个有用的配置值,可用于删除不需要的功能:

  • -防止CKEditor加载插件
  • -防止CKEditor向工具栏添加插件提供的特定按钮(尽管插件本身仍处于加载状态)

谢谢@Anna。禁用是指将其变灰。这将完全删除按钮。请更正您的问题,因为在标题中您还询问了如何隐藏。ckeditor 4.4.7可能是一些功能更改,这就是为什么
命令
没有
禁用(),启用()
方法的原因。