zoukankan      html  css  js  c++  java
  • fineui整合kindeditor的例子

    如果看不清:
    http://fineui.com/bbs/forum.php?mod=viewthread&tid=6683
     
    注意:高于fineui v4.2.0的版本kindeditor整合还是有bug,暂无办法处理。
     
    --------------以下正文--------------
     

    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
    </head>
    <body>
       <form id="form1" runat="server">
            <f:pageManager runat="server" />
            <f:ContentPanel runat="server" Height="300">


                <asp:TextBox runat="server" ID="Editor" Width="725px" Height="450px" TextMode="MultiLine"
                    Style="visibility: hidden;"></asp:TextBox>

             
            </f:ContentPanel>
           

           <f:Button runat="server" ID="btn" Text="取值" OnClientClick="getHtmlValue()" />
        </form>
    </body>
    </html>
    <link href="kindeditor/themes/default/default.css" rel="stylesheet">
    <link href="kindeditor/plugins/code/prettify.css" rel="stylesheet">
    <script src="kindeditor/kindeditor.js" charset="utf-8"></script>
    <script src="kindeditor/lang/zh_CN.js" charset="utf-8"></script>
    <script src="kindeditor/plugins/code/prettify.js" charset="utf-8"></script>
    <script>


        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('#<%=Editor.ClientID%>', {
                items: ['source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
                    'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                    'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                    'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
                    'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                    'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
                    'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
                    'anchor', 'link', 'unlink'],
                cssPath: 'kindeditor/plugins/code/prettify.css',
                uploadJson: 'kindeditor/asp.net/upload_json.ashx',
                fileManagerJson: 'kindeditor/asp.net/file_manager_json.ashx',
                allowFileManager: true,
            });

            editor.focus();
            prettyPrint();

        });


        function getHtmlValue() {
            // 同步数据后可以直接取得textarea的value,FineUI框架 button提交时先调用
            editor.sync();
        }

        //延时重新创建kindeditor(可能是因为extjs组件由于渲染过程比较慢,而kindeditor可能在指定节点创建之前就进行渲染,导致节点未找到等问题)
     Ext.onReady(function () {
            editor.remove().create();
        });
    </script>


    后台:
    protected void Page_Load(object sender, EventArgs e)
            {
                if (!IsPostBack)
                {
                    Editor.Text = "kindeditor整合例子";
                }
            }

            protected void btn_OnClick(object sender, EventArgs e)
            {
                Alert.Show(Editor.Text);
            }

  • 相关阅读:
    Vue Router详细教程
    Vue CLI使用
    百度点选识别,单字90+
    CPU毫秒级 | 极验点选识别
    Linux内核之进程管理
    Linux内核之基本概念
    MySQL InnoDB技术内幕:内存管理、事务和锁
    ZooKeeper简介
    分布式一致性协议之ZAB
    图解HTTP读书笔记
  • 原文地址:https://www.cnblogs.com/sundayisblue/p/7109749.html
Copyright © 2011-2022 走看看