PDA

View Full Version : [INFOREQ] HtmlEditor field gets disabled when the form panel is hidden and shown again



mx_starter
18 Dec 2012, 7:42 AM
REQUIRED INFORMATION
Ext version tested:

Ext 4.1.1.1
Browser versions tested against:

Firefox 17.0.1
Chrome 23.0
Description:

Simple grid with a listener for 'itemdblclick'.
Upon clicking on a row, a Ext.window.Window is created, containing a form panel, which in turn contains fields that are populated with data from the appropriate grid record.
One of the fields is 'htmleditor' xtype and on the first call - it is populated as expected.
When the window is closed (closeAction: 'hide') and then shown again, all other fields are populated with the new data. The 'htmleditor' field shows the new data for ~1/3 second. Then the data dissapears, the field becomes empty and unavailable for editing (nothing can be entered within, except in code editing mode)

mitchellsimoens
18 Dec 2012, 8:23 AM
Can I get a test case. This is a simple one that shows and hides a form:


var form,
panel = new Ext.panel.Panel({
renderTo : document.body,
dockedItems : [
{
xtype : 'toolbar',
dock : 'top',
items : [
{
text : 'Hide Form',
handler : function() {
if (!form) {
form = panel.down('form');
}

form.hide();
}
},
{
text : 'Show Form',
handler : function () {
if (!form) {
form = panel.down('form');
}

form.show();
}
}
]
}
],
items : [
{
xtype : 'form',
items : [
{
xtype : 'htmleditor',
anchor : '100% 100%'
}
]
}
]
});

mx_starter
19 Dec 2012, 6:19 AM
Thanks, this works, Mitchel.
Here is my code, i suppose the mistake is within:



var sbgItemEditForm = Ext.create('Ext.form.Panel', {


height: 500, width: 500, bodyPadding: 10,
defaultType: 'textfield',
items: [
{
xtype: 'htmleditor',
labelAlign: 'top',
height: 400,
fieldLabel: 'Html text',
name: 'itemLongDescription',
value: 'test value'
}
]
});



function loadItem()
{

Ext.create('Ext.window.Window', {
title: 'Window title',
id: 'itemWindow',
closable: true,
layout: 'fit',
draggable: true,
autoScroll: true,
closeAction: 'hide',
shadow: true,

items: [ sbgItemEditForm ]

}).show();

);

}