-
30 Jul 2010 1:42 PM #1
[OPEN-1169] Flex options is ignored for HtmlEditor in vbox layout
[OPEN-1169] Flex options is ignored for HtmlEditor in vbox layout
Ext version tested:
- Ext 3.2.1
Adapter used:- ext
css used:- only default ext-all.css
Description:- I wanted to use something similar to the form vbox layout example (http://www.sencha.com/deploy/dev/exa...vbox-form.html), with a htmleditor instead of a textarea.
I just changed the xtype of the field in the example, and the editor is just not correctly sized in the form (it remains of fixed height 304), and seems to completly ignore the flex option. This notably induces some problems with the scrolling of the htmleditor.
See the Test Case for a complete example of the problem.
Test Case:- See this URL : http://ext.planysphere.fr/ext/exampl...ditor-bug.html
Please, notice that there are two windows one on top of the other when the page is loaded, so drag one away to compare the behaviours.
Debugging already done:- By looking into the source code, I found that the layout ignores the flex option if it finds an height property in the field item, and beside that, I saw that the HtmlEditor sizes itself on render, thus giving itself an height even if none has been explicitly set.
This is the relevant bit of code, at the end of the HtmlEditor onRender method:
Code:if(!this.width){ var sz = this.el.getSize(); this.setSize(sz.width, this.height || sz.height); }
Possible fix:- Here is a fix usable with current version of ext, for people who might need to use this fonctionnality before it is fixed in the released version. Tested and working in FF/Chrome Linux.
Code:var htmleditor = new Ext.form.HtmlEditor({ xtype: 'htmleditor', fieldLabel: 'Message text', hideLabel: true, name: 'msg', flex: 1 // Take up all *remaining* vertical space // *Fix* Overridding the onRender method, in order to // unset the height and width property, so that the // layout manager won't consider this field to be of // fixed dimension, thus ignoring the flex option ,onRender: function() { Ext.form.HtmlEditor.prototype.onRender.apply(this, arguments); delete this.height; delete this.width; } });
-
24 Sep 2010 6:36 AM #2
Thanks for the fix!
Thanks for the fix!
This bug still exists in the latest Ext 3.3 beta - I didn't check the latest build.
Anyway, I am very grateful for your fix as this saves me a good many hours debugging and trying to come up with my own solution (probably an extension to the HtmlEditor
).
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[OPEN-770] vbox layout with collapsible items
By vladsch in forum Ext 3.x: BugsReplies: 11Last Post: 12 Aug 2010, 12:08 PM -
vBox layout with flex and hiding a panel
By Keith Chadwick in forum Ext 3.x: Help & DiscussionReplies: 4Last Post: 8 Dec 2009, 8:48 AM -
vbox in tabbed containers flex not filling height
By ImShogun in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 5 Dec 2009, 1:54 AM -
NEWS: Adobe flex goes open source
By jay@moduscreate.com in forum Community DiscussionReplies: 2Last Post: 26 Apr 2007, 9:52 AM


Reply With Quote