Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Disabling spellcheck in htmleditor

  1. #1
    Sencha User
    Join Date
    Aug 2009
    Posts
    20

    Default Disabling spellcheck in htmleditor

    Hi,

    With Firefox, a spellchecking is by default activated in textareas, and so in HtmlEditor

    In a standard TextArea, in can disable spellcheck by adding spellsheck:false in the autoCreate config option :
    Code:
    var MyForm = new Ext.form.TextArea({
      autoCreate:{tag: "textarea", style: "width:100px;height:60px;", autocomplete: "off", spellcheck:false}
    });
    But there is no autoCreate option for Ext.from.HtmlEditor.
    How I can do that ?

    Thank for your help

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Set it on the DOM after render.

  3. #3
    Sencha User
    Join Date
    Aug 2009
    Posts
    20

    Default

    Set it on the DOM after render.
    Can you be more explicit please ? I am not an expert in ExtJS. An example would be a good idea.

    Thank for your help

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    add a render listener

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    To disable spellcheck in Source Edit mode you can use:
    Code:
    var editor = new Ext.form.HTMLEditor({
      autoCreate: {
        tag: "textarea",
        style: "width:500px;height:300px;",
        autocomplete: "off"
        spellcheck: "false"
      }
    });
    I don't even know if you can even set this flag on the editable IFRAME used for HTML Edit mode.
    If you can then you can't use the 'render' event, because it fires to early. You need to do an inline override of initEditor for that.

  6. #6
    Sencha User
    Join Date
    Aug 2009
    Posts
    20

    Default

    Thank's Condor, but spellcheck=false doesn't work whith htmleditor :
    Code:
    var editor = new Ext.form.HtmlEditor({
      renderTo:Ext.getBody(),
      autoCreate: {
        tag: "textarea",
        style: "width:500px;height:300px;",
        spellcheck: "false"
      }
    });
    Test:
    htmleditor.jpg
    The red underline is still present...

  7. #7
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Read my comment again: This only disables spellchecking in SOURCE MODE.

    For HTML MODE you need to do something completely different (and I'm not sure what that is).

  8. #8
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    It appears you can't turn it off. I have just tried poking the DOM to add spellcheck as false to all the DOM elements, and it won't do it.

    Couldn't you have done that? It's just a bit of faddling with the developer tools.

  9. #9
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Quote Originally Posted by Animal View Post
    It appears you can't turn it off. I have just tried poking the DOM to add spellcheck as false to all the DOM elements, and it won't do it.
    Don't be so quick with your conclusion! I could get it to disable spellchecking:
    Code:
    new Ext.form.HtmlEditor({
        autoCreate: {
            tag: "textarea",
            style: "width:500px;height:300px;",
            autocomplete: "off",
            // disable spellcheck in source mode
            spellcheck: "false"
        },
        getDocMarkup : function(){
            var h = Ext.fly(this.iframe).getHeight() - this.iframePad * 2;
            return String.format('<html><head><style type="text/css">body{border: 0; margin: 0; padding: {0}px; height: {1}px; cursor: text}</style></head><body ' +
            // disable spellcheck in html mode
            'spellcheck="false"' +
            '></body></html>', this.iframePad, h);
        }
    })

  10. #10
    Sencha User
    Join Date
    Aug 2009
    Posts
    20

    Default

    Condor, you're great. The spellcheck=false in getDocMarkup work nice. Not so obvious...

    Thank's again

Page 1 of 2 12 LastLast

Similar Threads

  1. Disabling BoxComponent.
    By denizkaan in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 1 Oct 2009, 12:31 AM
  2. disabling F5 refresh
    By tomlobato in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 9 Nov 2008, 11:47 AM
  3. disabling everything
    By KciNicK in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 20 Jan 2008, 12:25 PM
  4. Disabling opacity
    By fermo111 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 11 Dec 2007, 7:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •