views:

832

answers:

1

When I create HtmlEditor on a form and assign it's anchor value large negative number there appears absolutely unnecessary vertical scrollbar. Hot to get rid of it? If I resize Ext window scrollbar disappears. I've tried to set handlers for various window events (resize, show, *render) and call there doRender() — no success.

Here is the code:

var htmlEditor = new Ext.form.HtmlEditor({
    anchor: '100% -106',
    hideLabel: true
});

var fp = new Ext.form.FormPanel({
    items: [
         {xtype: 'textfield', fieldLabel: 'aaa', mode: 'local', anchor : '100%'}, 
         {xtype: 'textfield', fieldLabel: 'bbb', mode: 'local', anchor : '100%'}, 
         {xtype: 'textfield', fieldLabel: 'bbb', mode: 'local', anchor : '100%'}, 
         {xtype: 'textfield', fieldLabel: 'ccc', mode: 'local', anchor : '100%'}, 
     htmlEditor]
});

var w = new Ext.Window({layout: 'fit',
    height: 400, width: 600,
    //tbar: [{text: 'click'}],
    items: fp 
});

w.show();

Updated Kind of workaround, exetend class Ext.form.HtmlEditor and redefine method getDocMarkup:

MyHtmlEditor = Ext.extend(Ext.form.HtmlEditor, {

    getDocMarkup : function(){
        return '<html><head><style type="text/css">body{border:0;margin:0;padding:3px;cursor:text;}</style></head><body></body></html>';
    }
});

I've removed height:98% from the styles list.

+1  A: 

I had a similar issue, so your suggestion worked for me nicely! Thanks :)

Andron
Again, found this answer and it helped too :)
Andron