如何在c#中隐藏ckeditor的所有工具栏

时间:2016-12-23 08:14:31

标签: javascript c# ckeditor

这是页面顶部的assmbly:

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

这是:

   <CKEditor:CKEditorControl ID="CKEditor1" BasePath="/ckeditor/" runat="server" EditingBlock="true" toolbar="emptyToolbar" ></CKEditor:CKEditorControl>

这是config.js:

CKEDITOR.editorConfig = function (config) {
    // Define changes to default configuration here.
    // For complete reference see:
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config

    // The toolbar groups arrangement, optimized for a single toolbar row.
    config.toolbarGroups = [
        { name: 'document', groups: ['mode', 'document', 'doctools'] },
        { name: 'clipboard', groups: ['clipboard', 'undo'] },
        { name: 'editing', groups: ['find', 'selection', 'spellchecker'] },
        { name: 'forms' },
        { name: 'basicstyles', groups: ['basicstyles', 'cleanup'] },
        { name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi'] },
        { name: 'links' },
        { name: 'insert' },
        { name: 'styles' },
        { name: 'colors' },
        { name: 'tools' },
        { name: 'others' },
        { name: 'about' }
    ];

    // The default plugins included in the basic setup define some buttons that
    // are not needed in a basic editor. They are removed here.
    config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';

    // Dialog windows are also simplified.
    config.removeDialogTabs = 'link:advanced';



};

我该怎么办?

如何禁用所有工具栏? 如何隐藏ckeditor的所有工具栏..我只想要一个ck编辑器的textarea。

1 个答案:

答案 0 :(得分:0)

将此行添加到config.js文件

config.removePlugins= 'toolbar';

<强>更新

使用css

   <head>
     <style> 
        .cke_top { display: none !important } 
     </style> 
   </head>