PDA

View Full Version : HTMLEditor issue when using form load



philance
2 Apr 2012, 9:26 AM
Hi,

I have a form with more than 2 htmleditor



,{
fieldLabel :'Address',
xtype :'htmleditor',
id :'address',
name :'address',
height :90,
allowBlank :false
},{
fieldLabel :'Contact',
xtype :'htmleditor',
id :'contact',
name :'contact',
autoRender :true,
height :90,
allowBlank :false
}

If I do not use form.load, both htmleditor are okay. However whenever I load the form using:



newjlform.load({
url: weburl+'joblogs/adddata/customerid/'+customerid+'/joblogtypeid/'+joblogtypeid,
failure: function(form, action) {
Ext.Msg.alert("Load failed", action.result.errorMessage);
}
});

then the 2nd htmleditor froze, cannot see the content of it, cannot even type word inside it. the first htmleditor is okay.

Is it a bug, or my code has error somewhere?

Please help bro. Appreciate your help.

Rgds,

mitchellsimoens
3 Apr 2012, 11:19 AM
What version of Ext JS 4 are you seeing this on and browser?

I tried Chrome 18 (Lion) on Ext JS 4.1.0 RC1 with this code/JSON and didn't have any issue:


new Ext.form.Panel({
renderTo : document.body,
width : 400,
height : 400,
items : [
{
xtype : 'htmleditor',
fieldLabel : 'Test',
name : 'address'
},
{
xtype : 'htmleditor',
fieldLabel : 'Test',
name : 'contact'
},
{
xtype : 'button',
text : 'Load',
handler : function(button) {
var form = button.up('form');

form.load({
url : 'data/json.json'
});
}
}
]
});


{
"success" : true,
"data" : {
"address" : "bam!",
"contact" : "test"
}
}

philance
4 Apr 2012, 6:31 AM
Thx a lot Mitchellsimoens.

So sorry that I forgot to mention the Extjs version and Browser version. Currently I use extjs 4.0.7, and Firefox v11

You are right that when I use Chrome, it's okay.

I found another strange thing is that: on the htmleditor that has issue, if I press Source Code button (and after that press again to back to normal mode), then that editor is back to normal, means can show content, can edit. That's a bit weird.

mitchellsimoens
4 Apr 2012, 6:39 AM
Hmm... tried with 4.0.7 and 4.1.0 RC2 on Firefox 11 on Lion and am still not able to reproduce with my simple test.

philance
4 Apr 2012, 7:02 AM
Oops, after wasting a lot of time to troubleshoot ... I finally found the culprit: xtype : 'container'. Really dun know why yet, but remove it solve the issue ... 8-|

mitchellsimoens
4 Apr 2012, 7:04 AM
At least you figured it out! =D>

philance
4 Apr 2012, 7:11 AM
At least you figured it out! =D>

Btw, Mitchellsimoens, thank you very much for your response :">. Should I call you Mitchell or Simoens? Really appreciate your help and fast response.

mitchellsimoens
4 Apr 2012, 7:21 AM
I get called by many names, some good some bad :D

I prefer Mitchell and you're always welcome.