PDA

View Full Version : HtmlEditor in center-area of border-layout



cowabunga1984
22 Oct 2007, 7:14 AM
Hi,

first of all: ExtJS is a very nice Framework ;)

But I have a problem with HtmlEditor in combination with BorderLayout. Here my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ExtJs - Example</title>

<!-- Include YUI utilities and Ext: -->
<script type="text/javascript" src="web/js/ext1_1_1/adapter/yui/yui-utilities.js"></script>
<script type="text/javascript" src="web/js/ext1_1_1/adapter/yui/ext-yui-adapter.js"></script>
<script type="text/javascript" src="web/js/ext1_1_1/ext-all-debug.js"></script>

<!-- Include Ext stylesheets here: -->
<link rel="stylesheet" type="text/css" href="web/js/ext1_1_1/resources/css/ext-all.css">
<link rel="stylesheet" type="text/css" href="web/js/ext1_1_1/resources/css/ytheme-vista.css">

<!-- Init namespace -->
<script type="text/javascript">
Ext.onReady(function() {
// init dialog
var myDivDialog = Ext.DomHelper.append(document.body, '<div></div>', true);

var myDialog = new Ext.LayoutDialog(myDivDialog, {
height: 650,
modal: true,
resizable: false,
width: 700,
north: {
initialSize: 100
},
center: {}
});

// init form
var myDivDetailForm = Ext.DomHelper.append(document.body,
'<div style="padding: 10px"></div>', true);

var myDetailFormPnl = new Ext.ContentPanel(myDivDetailForm, {
autoScroll: true,
fitToFrame: true
});

var myDetailForm = new Ext.form.Form({
labelWidth: 100,
url: 'index.php'
});

// init fields
var myDescriptionField = new Ext.form.HtmlEditor({
fieldLabel: 'Beschreibung',
height: 200,
name: 'description',
width: 550
});

// merge fields and form
myDetailForm.add(myDescriptionField);

myDetailForm.render(myDetailFormPnl.getEl());

myDialog.getLayout().beginUpdate();
myDialog.getLayout().add('center', myDetailFormPnl);
myDialog.getLayout().endUpdate();

myDialog.show();
});
</script>
</head>
<body>
</body>
</html>Firefox throws a lot of Exceptions like this:

uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.designMode]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://localhost/workspace_php/extjs05_bug/web/js/ext1_1_1/ext-all-debug.js :: anonymous :: line 23242" data: no]

Line 0Maybe it is a bug?

Best regards
cowabunga1984