PDA

View Full Version : [FIXED][3.x] Same htmleditor?



stever
8 May 2009, 7:24 PM
new Ext.Window({
height: 300,
width: 400,
layout:'fit',
items:{
xtype:'tabpanel',
items:[{
title:'tab1',
xtype:'htmleditor',
},{
title:'tab2',
xtype:'htmleditor',
}],
activeItem:0
}
}).show();

When I switch tabs, they are the same editor???

Oooh..., even more fun. Try using the editor source button in tab1 and then click on tab2!

stever
8 May 2009, 7:27 PM
Oh, and after resizing the window. :)

evant
8 May 2009, 8:08 PM
Tab panels rely on having a panel as a child, what happens if you wrap the editors in a panel first?

Condor
8 May 2009, 10:11 PM
No, TabPanel doesn't require items to be Panels at all (good thing, because I use Containers and BoxComponents all the time).

The solution is real easy:

Ext.override(Ext.form.HtmlEditor, {
actionMode: 'wrap'
});

And if this gets implemented I also suggest fixing:

Ext.override(Ext.form.TriggerField, {
actionMode: 'wrap',
onShow: Ext.form.TriggerField.superclass.onShow,
onHide: Ext.form.TriggerField.superclass.onHide
});
Ext.override(Ext.form.Checkbox, {
actionMode: 'wrap',
getActionEl: Ext.form.Checkbox.superclass.getActionEl // only for Ext 2.x
});

stever
9 May 2009, 10:47 AM
No, TabPanel doesn't require items to be Panels at all (good thing, because I use Containers and BoxComponents all the time).

The solution is real easy:

Ext.override(Ext.form.HtmlEditor, {
actionMode: 'wrap'
});
[/CODE]

I went to http://extjs.com/deploy/ext-3.0-rc1.1/docs/ and searched for actionMode and came up with nothing. What is that?

Condor
9 May 2009, 11:23 AM
actionMode is the name of the element returned by getActionEl.
The actionEl is the element on which enable,.disable, hide and show actions are performed.

Special case: If actionMode == 'container' it is also destroyed in destroy().

stever
18 May 2009, 10:50 AM
Thanks, btw, I added it to my plugin based version of the htmleditor. I'll have to post the code for the set of classes sometime soon.

mjlecomte
3 Jun 2009, 12:48 PM
I went to http://extjs.com/deploy/ext-3.0-rc1.1/docs/ and searched for actionMode and came up with nothing. What is that?

Searching docs is unreliable unless you grep the source directly.

stever
3 Jun 2009, 3:34 PM
Yeah, I found it. Marked private though, so not much documentation except for the source itself. Which is fine...

evant
16 Jun 2009, 10:42 AM
Fixed in SVN.

mystix
16 Jun 2009, 7:33 PM
heads up: the Checkbox#getActionEl() fix was accidentally omitted from the 2.x branch:


Ext.override(Ext.form.Checkbox, {
actionMode: 'wrap',
getActionEl: Ext.form.Checkbox.superclass.getActionEl // only for Ext 2.x
});

evant
16 Jun 2009, 7:39 PM
Got it, thanks.