[CLOSED] [#477] HtmlEditor icw IE11

  1. #1

    [CLOSED] [#477] HtmlEditor icw IE11

    Hi, I started migrating to V2.5 but get errors with the HtmlEditor control in IE11 (in Chrome it works).

    When I click in the editor area of the HtmlEditor control I get a javascript error:

       0x800a138f - JavaScript runtime error: Unable to get property 'createRange' of undefined or null reference
    
      onEditorEvent:function(){if(Ext.isIE){this.currentRange=this.getDoc().selection.createRange();}
    I use Ext.dll (2.5.1.24957, for .NET 4.0).

    The problem seems to be a local problem, on an other development computer I do not get the error.
    I tried flushing browser cache/reboot/etc. but it does not help. Do you have any idea wat causes the problem?

    Thanks,
    Sander
    Last edited by Daniil; Jan 18, 2015 at 4:56 PM. Reason: [CLOSED]
  2. #2
    The issue is fixed in SVN already, please update and retest
  3. #3
    With the latest version from SVN I do not get the error anymore when clicking in the editor.
    When I however try to insert text in the editor using javascript I get a similar error:

    0x800a138f - JavaScript runtime error: Unable to get property 'createRange' of undefined or null reference
      
    insertAtCursor:function(text){if(!this.activated){return;}
    this.win.focus();if(Ext.isIE){var doc=this.getDoc(),r=this.currentRange||doc.selection.createRange();
    doc.selection == undefined

    <%@ Page Language="C#" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Button ID="InsertTxtButton" runat="server"
                Text="Insert txt">
                <Listeners>
                    <Click Handler="#{Editor}.insertAtCursor('xyz...');" />
                </Listeners>
            </ext:Button>
            <ext:HtmlEditor ID="Editor" runat="server"
                Width="300"
                Height="240">
            </ext:HtmlEditor>
        </form>
    </body>
    </html>
    Ext.NET version: 2.5.1.29828

    Thanks for your help.
    Sander
  4. #4
    Thank you for the report. Please update and retest.
  5. #5
    Quote Originally Posted by Daniil View Post
    Thank you for the report. Please update and retest.
    I do not get the error anymore, but no text is inserted with the sample code. Is the sample correct?
  6. #6
    Yes, the sample is correct.

    I confirm the insertAtCursor method doesn't work in IE11. There is a problem with that in IE11.
    http://stackoverflow.com/questions/3...ernet-explorer

    Here is a possible fix, but it wraps the inserted text in an additional span element. I cannot find a way to avoid it.

    Fix
    Ext.form.field.HtmlEditor.override({
        insertAtCursor : function (text) {
            var doc, r, nnode;
    
            if (!this.activated) {
                return;
            }
            
            this.win.focus();
            if (Ext.isIE && !Ext.isIE11) {
                doc = this.getDoc();
                r = this.currentRange || doc.selection.createRange();
    
                if (r) {
                    r.pasteHTML(text);
                    this.syncValue();
                    this.deferFocus();
                }
            } else if (Ext.isIE11) {
                doc = this.getDoc();
                r = doc.getSelection().getRangeAt(0);
    
                nnode = doc.createElement("span"); // Is there any way to avoid that? I cannot find...
                r.surroundContents(nnode);
                nnode.innerHTML = text;
            } else {
                this.execCmd("InsertHTML", text);
                this.deferFocus();
            }
        }
    });
  7. #7
    The fix works, thanks Daniil!
  8. #8
    Thank you for confirming. I've committed the fix to the trunk, the revision #5819.
    Last edited by Daniil; May 05, 2014 at 7:24 AM.

Similar Threads

  1. [CLOSED] Tooltips with wrong size in IE11
    By RCN in forum 2.x Legacy Premium Help
    Replies: 13
    Last Post: Jan 22, 2015, 10:34 AM
  2. [CLOSED] IE11 support with Ext JS 3.4.2
    By anup in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jan 30, 2014, 3:02 PM
  3. [CLOSED] IE11 missing toolbar backgrounds
    By prointernet in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 30, 2014, 12:08 PM
  4. [CLOSED] IE11 Tool Tips
    By Kev in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 10, 2014, 11:20 AM
  5. [CLOSED] IE11 and Chrome
    By ATLAS in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 13, 2013, 12:25 PM

Tags for this Thread

Posting Permissions