[CLOSED] HtmlEditor as a editor issue

  1. #1

    [CLOSED] HtmlEditor as a editor issue

    hi,i am in trouble with the htmlediot in edtor
    1,when pop up the htmleditor, i edit it . the editor can not auto disappear after editing.
    2,the htmleditor is out of page.

    sample code
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm54.aspx.cs" Inherits="web.qizweb.com.test.WebForm54" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script runat="server">
            protected void LoadAnnounce(object sender, StoreReadDataEventArgs e)
                var ll = new object[]
                    new {id=1,title="aaa",info="bbb",addtime="1992-11-28 12:23:33"},
                    new {id=2,title="aaa",info="bbb",addtime="1992-11-28 12:23:33"},
                    new {id=3,title="aaa",info="bbb",addtime="1992-11-28 12:23:33"},
                    new {id=4,title="aaa",info="bbb",addtime="1992-11-28 12:23:33"},
                    new {id=5,title="aaa",info="bbb",addtime="1992-11-28 12:23:33"},
                    new {id=6,title="aaa",info="bbb",addtime="1992-11-28 12:23:33"}
                e.Total = 6;
                s_announce.DataSource = ll;
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server" SourceFormatting="True"></ext:ResourceManager>
            <ext:GridPanel runat="server" Title="公告管理">
                    <ext:Store runat="server" ID="s_announce" OnReadData="LoadAnnounce">
                            <ext:Model runat="server">
                                    <ext:ModelField Name="id"></ext:ModelField>
                                    <ext:ModelField Name="title"></ext:ModelField>
                                    <ext:ModelField Name="info"></ext:ModelField>
                                    <ext:ModelField Name="addtime"></ext:ModelField>
                        <ext:Column runat="server" DataIndex="id" Text="编号"></ext:Column>
                        <ext:Column runat="server" DataIndex="title" Text="标题">
                                <ext:TextField runat="server"></ext:TextField>
                        <ext:Column runat="server" DataIndex="info" Text="内容" Flex="1">
                                <ext:HtmlEditor runat="server"></ext:HtmlEditor>
                        <ext:DateColumn runat="server" DataIndex="addtime" Text="入库时间" Format="yyyy-MM-dd HH:mm:ss" Width="140"></ext:DateColumn>
                    <ext:CellEditing runat="server"></ext:CellEditing>
                    <ext:RowSelectionModel runat="server" Mode="Multi"></ext:RowSelectionModel>
    Last edited by Daniil; Jun 17, 2014 at 11:39 AM. Reason: [CLOSED]
  2. #2
    Hi @hdsoso,

    Yes, it might be too problematic or just impossible to use an HtmlEditor as a Column's Editor. Mostly, because of the fact that an HtmlEditor uses an iframe.

    As a possible solution I can suggest to use a TriggerField in a similar way as it is done in this example.
  3. #3
    can place a htmleditor into the window in above example?
    could you please provide an example of poping up a window which in it there is a htmleditor when click a cell ,after editing , the htmledtor's text will place into the cell?
  4. #4
    Quote Originally Posted by hdsoso View Post
    can place a htmleditor into the window in above example?
    Please just put an HtmlEditor into a Window's Items.
  5. #5
    Cannot call method 'saveValue' of undefined
    Click image for larger version. 

Name:	QQ??20140607085329.png 
Views:	26 
Size:	30.5 KB 
ID:	12301
    setCompany not execute ?
    the text of cell can not load to htmleditor's text?
            var triggerClick = function (el, trigger, tag, auto, index) {
                switch (tag) {
                    case "pick":
                        var w = App.PickWindow;
                        w.editor = el;
                        w.autoComplete = auto;
                        w.show(trigger, function () {
                    case "complete":
            var setCompany = function (w) {
                var record = App.CellEditing1.getActiveRecord(),
                    company = w.editor.getValue();
                //   rating = record.get("rating");
            var saveCompany = function (w) {
               // App.CellEditing1.getActiveRecord().set("rating", App.CompanyRating.getChecked()[0].tag);
     <ext:ResourceManager runat="server" SourceFormatting="True"></ext:ResourceManager>
            <ext:Window runat="server" ID="PickWindow" Title="内容" Hidden="true" Width="300" Height="250">
                    <ext:Panel runat="server">
                            <ext:HtmlEditor runat="server" ID="HtmlEditor1"></ext:HtmlEditor>
                            <ext:ConfigItem Name="initValue" Value="setCompany" Mode="Raw" />
                            <ext:ConfigItem Name="saveValue" Value="saveCompany" Mode="Raw" />
                    <ext:Button runat="server" Text="OK">
                            <Click Handler="#{PickWindow}.hide(); #{PickWindow}.layout.activeItem.saveValue(#{PickWindow}); if (#{PickWindow}.autoComplete) {#{CellEditing1}.completeEdit();}" />
                    <ext:Button runat="server" Text="Cancel">
                            <Click Handler="#{PickWindow}.hide(); if (#{PickWindow}.autoComplete) {#{CellEditing1}.cancelEdit();}" />
       <ext:Column runat="server" DataIndex="info" Text="内容" Flex="1">
                                        <ext:TriggerField runat="server">
                                                <ext:FieldTrigger Icon="SimpleEllipsis" Tag="pick" />
                                                <ext:FieldTrigger Icon="SimpleTick" Tag="complete" />
                                                <TriggerClick Handler="triggerClick(this, trigger, tag, true, 0);" />
                                    <EditorOptions AllowBlur="false" />
                            <ext:CellEditing runat="server" ID="CellEditing1">
                                    <Edit OnEvent="EditAnn">
                                            <ext:Parameter Name="title" Value="e.record.data.title" Mode="Raw" />
                                            <ext:Parameter Name="info" Value="e.record.data.info" Mode="Raw" />
                                            <ext:Parameter Name="id" Value="e.record.data.id" Mode="Raw" />
  6. #6
    Please provide a full test case.

Similar Threads

  1. HTMLEditor on Editor Field
    By pankyhehe in forum 1.x Help
    Replies: 0
    Last Post: Dec 29, 2011, 9:03 AM
  2. [CLOSED] HtmlEditor Issue in IE 9
    By logicspeak in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 15, 2011, 8:38 PM
  3. [CLOSED] HTMLEditor Issue after last Update
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 27, 2010, 2:05 PM
  4. HtmlEditor Issue
    By DasPhansom in forum 1.x Help
    Replies: 2
    Last Post: Sep 28, 2009, 11:57 AM
  5. [CLOSED] Editor + HtmlEditor questions
    By jchau in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 21, 2009, 1:35 PM

Posting Permissions