PDA

View Full Version : extjs htmleditor display errors with firebug



vectorbai
27 Jun 2013, 4:43 AM
The follow code is work correctly ,when xtype: textarea change to 'htmleditor' and firebug display error. It display like NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLDocument.execCommand].why? IT'S BUG? shall i do ?
extjs htmleditor could not work in panel?

//4.1 official code:
absoluteForm: {
title: 'Absolute Layout Form',
id: 'abs-form-panel',
layout: 'fit',
bodyPadding: 15,
items: {
title: 'New Email',
layout: 'fit',
frame: true,
border: false,
items: {
xtype: 'form',
layout:'absolute',
url:'save-form.php',
padding: '5 5 0 5',
border: false,
cls: 'absolute-form-panel-body',

defaultType: 'textfield',
items: [{
x: 0,
y: 5,
xtype: 'label',
text: 'From:'
},{
x: 55,
y: 0,
name: 'from',
hideLabel: true,
anchor:'100%' // anchor width by %
},{
x: 0,
y: 32,
xtype: 'label',
text: 'To:'
},{
x: 55,
y: 27,
width: 69,
xtype: 'button',
text: 'Contacts'
},{
x: 127,
y: 27,
name: 'to',
hideLabel: true,
anchor: '100%' // anchor width by %
},{
x: 0,
y: 59,
xtype: 'label',
text: 'Subject:'
},{
x: 55,
y: 54,
name: 'subject',
hideLabel: true,
anchor: '100%' // anchor width by %
},{
x: 0,
y: 81,
hideLabel: true,
xtype: 'textarea',
// xtype: 'htmleditor',
name: 'msg',
anchor: '100% 100%' // anchor width and height
}]
},

dockedItems: [
{
xtype: 'toolbar',
border: false,
cls: 'absolute-form-panel-body',
items: [
{
text: 'Send',
iconCls: 'icon-send'
},'-',{
text: 'Save',
iconCls: 'icon-save'
},{
text: 'Check Spelling',
iconCls: 'icon-spell'
},'-',{
text: 'Print',
iconCls: 'icon-print'
},'->',{
text: 'Attach a File',
iconCls: 'icon-attach'
}
]
}
]
//end dock
}

--

friend
27 Jun 2013, 5:25 AM
You're missing a closing curly brace around the items object which encloses your form.

I put your layout into a Window for testing and this works for me on Firefox 21.0:




Ext.create('Ext.window.Window', {
title: 'Absolute Layout Form',
id: 'abs-form-panel',
layout: 'fit',
bodyPadding: 15,
items: {
title: 'New Email',
layout: 'fit',
frame: true,
border: false,
items: {
xtype: 'form',
layout:'absolute',
url:'save-form.php',
padding: '5 5 0 5',
border: false,
cls: 'absolute-form-panel-body',
defaultType: 'textfield',
items: [{
x: 0,
y: 5,
xtype: 'label',
text: 'From:'
},{
x: 55,
y: 0,
name: 'from',
hideLabel: true,
anchor:'100%' // anchor width by %
},{
x: 0,
y: 32,
xtype: 'label',
text: 'To:'
},{
x: 55,
y: 27,
width: 69,
xtype: 'button',
text: 'Contacts'
},{
x: 127,
y: 27,
name: 'to',
hideLabel: true,
anchor: '100%' // anchor width by %
},{
x: 0,
y: 59,
xtype: 'label',
text: 'Subject:'
},{
x: 55,
y: 54,
name: 'subject',
hideLabel: true,
anchor: '100%' // anchor width by %
},{
x: 0,
y: 81,
hideLabel: true,
xtype: 'htmleditor',
name: 'msg',
anchor: '100% 100%'
}]
}
},
dockedItems: [{
xtype: 'toolbar',
border: false,
cls: 'absolute-form-panel-body',
items: [{
text: 'Send',
iconCls: 'icon-send'
},'-',{
text: 'Save',
iconCls: 'icon-save'
},{
text: 'Check Spelling',
iconCls: 'icon-spell'
},'-',{
text: 'Print',
iconCls: 'icon-print'
},'->',{
text: 'Attach a File',
iconCls: 'icon-attach'
}]
}]
}).show();Ext.create('Ext.window.Window', {
title: 'Absolute Layout Form',
id: 'abs-form-panel',
layout: 'fit',
bodyPadding: 15,
items: {
title: 'New Email',
layout: 'fit',
frame: true,
border: false,
items: {
xtype: 'form',
layout:'absolute',
url:'save-form.php',
padding: '5 5 0 5',
border: false,
cls: 'absolute-form-panel-body',
defaultType: 'textfield',
items: [{
x: 0,
y: 5,
xtype: 'label',
text: 'From:'
},{
x: 55,
y: 0,
name: 'from',
hideLabel: true,
anchor:'100%' // anchor width by %
},{
x: 0,
y: 32,
xtype: 'label',
text: 'To:'
},{
x: 55,
y: 27,
width: 69,
xtype: 'button',
text: 'Contacts'
},{
x: 127,
y: 27,
name: 'to',
hideLabel: true,
anchor: '100%' // anchor width by %
},{
x: 0,
y: 59,
xtype: 'label',
text: 'Subject:'
},{
x: 55,
y: 54,
name: 'subject',
hideLabel: true,
anchor: '100%' // anchor width by %
},{
x: 0,
y: 81,
hideLabel: true,
xtype: 'htmleditor',
name: 'msg',
anchor: '100% 100%'
}]
}
},
dockedItems: [{
xtype: 'toolbar',
border: false,
cls: 'absolute-form-panel-body',
items: [{
text: 'Send',
iconCls: 'icon-send'
},'-',{
text: 'Save',
iconCls: 'icon-save'
},{
text: 'Check Spelling',
iconCls: 'icon-spell'
},'-',{
text: 'Print',
iconCls: 'icon-print'
},'->',{
text: 'Attach a File',
iconCls: 'icon-attach'
}]
}]
}).show();

vectorbai
27 Jun 2013, 5:19 PM
Follow code is official code,when change xtype: 'textarea' to 'htmleditor',firebug console will display error that NS_ERROR_FAILURE: Failure! I'm sure that is a bug!



* ================ AnchorLayout config =======================
*/
anchor: {
title: 'Absolute Layout Form',
id: 'anchor-panel',
layout: 'fit',
bodyPadding: 15,
items: {
title: 'New Email',
layout: 'fit',
frame: true,
border: false,
items: {
xtype: 'form',
layout:'absolute',
url:'save-form.php',
padding: '5 5 0 5',
border: false,
cls: 'absolute-form-panel-body',
defaultType: 'textfield',
items: [{
x: 0,
y: 5,
xtype: 'label',
text: 'From:'
},{
x: 55,
y: 0,
name: 'from',
hideLabel: true,
anchor:'100%' // anchor width by %
},{
x: 0,
y: 32,
xtype: 'label',
text: 'To:'
},{
x: 55,
y: 27,
width: 69,
xtype: 'button',
text: 'Contacts'
},{
x: 127,
y: 27,
name: 'to',
hideLabel: true,
anchor: '100%' // anchor width by %
},{
x: 0,
y: 59,
xtype: 'label',
text: 'Subject:'
},{
x: 55,
y: 54,
name: 'subject',
hideLabel: true,
anchor: '100%' // anchor width by %
},{
x: 0,
y: 81,
hideLabel: true,
xtype: 'htmleditor',
// xtype: 'textarea',
name: 'msg',
anchor: '100% 100%'
}]
}
},
dockedItems: [{
xtype: 'toolbar',
border: false,
cls: 'absolute-form-panel-body',
items: [{
text: 'Send',
iconCls: 'icon-send'
},'-',{
text: 'Save',
iconCls: 'icon-save'
},{
text: 'Check Spelling',
iconCls: 'icon-spell'
},'-',{
text: 'Print',
iconCls: 'icon-print'
},'->',{
text: 'Attach a File',
iconCls: 'icon-attach'
}]
}]
}