[CLOSED] Html editor text update

  1. #1

    [CLOSED] Html editor text update

    Hi
    whats the best way to append a text to an html editor.
    The editor is a messaging panel that receives a new message after every 10 seconds and we need also to scroll to the last message that was appended to the editor.

    At the moment I am doing this to append the message.
    editor.setValue(String.format('{0} {1}',editor.getValue() messages));
    But I believe there shoould be a more efficient way of appending new text to the html control
    Last edited by Daniil; Feb 10, 2012 at 3:19 PM. Reason: [CLOSED]
  2. #2
    Hi,

    There is the append method.

    How to scroll please look at the example.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var onUpdate = function (editor) {
                var b = editor.getEditorBody();
    
                editor.append('new message<br/>');
                b.scrollTop = b.scrollHeight;
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:HtmlEditor ID="HtmlEditor1" runat="server" />
            <ext:TaskManager runat="server" AutoRunDelay="1000">
                <Tasks>
                    <ext:Task Interval="1000">
                        <Listeners>
                            <Update Handler="onUpdate(HtmlEditor1);" />
                        </Listeners>
                    </ext:Task>
                </Tasks>
            </ext:TaskManager>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] Not able to Copy the Text from HTML Editor
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 21, 2011, 8:10 AM
  2. Replies: 1
    Last Post: Nov 16, 2010, 3:59 AM
  3. html editor highlight and text color buttons
    By [WP]joju in forum 1.x Help
    Replies: 5
    Last Post: May 06, 2010, 8:38 AM
  4. HTMl Editor Clear Text.
    By grmontero in forum 1.x Help
    Replies: 3
    Last Post: Oct 01, 2009, 7:49 PM
  5. Replies: 3
    Last Post: Jun 15, 2008, 10:41 AM

Posting Permissions