PDA

View Full Version : Object initialization



newusername
18 Dec 2012, 9:48 PM
HI all,


I am very much new to ext js


I have very small code as follow


<html>

<head>
<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css">
<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all-debug.js"></script>
<script type="text/javascript">

Ext.onReady(function(){
var form = Ext.extend(Ext.form.FormPanel,{
title: 'Test',
id:'form',
height:300,
width:500,
padding:20,
margins:50,
border:true,
style:{margin:'40'},
items : [
{
xtype:'textfield',
fieldlabel : 'name'

}
],

initComponent: function(){
form.superclass.initComponent.call(this);

}



});

var myForm= new form();

myForm.render(document.body);

});


</script>

</head>

<body>

</body>
</html>








so When I write items outside of initcomponent it shows error but when I write it inside inticomponenet method it runs fine ... I am not getting what is the problem here ..

mitchellsimoens
20 Dec 2012, 10:22 AM
The items mixedcollection is not created because the items property is set on the prototype.