EjChuLim
13 Apr 2012, 12:49 AM
I am a beginner in extjs and extjs 4, and i have been looking at examples of making a form. i decided learn how to make the structure first using notepad++ then i had am having a hard time displaying the panel and grid.
this is my app.js code:
Ext.define('registration',
{
extend:'Ext.form.Panel',
alias: 'widget.form',
title:'Form',
defaultType:'textfield',
items: [{
fieldLabel: 'Name',
name:'name',
allowBlank:false
},{
fieldLabel:'Email',
name:'mail',
allowBlank:false,
vtype:'mail'
},{
fieldLabel:'Password',
inputType:'password',
name:'pass',
allowBlanl:false
},{
xtype:'button',
text:'Submit',
//handler:'blank.php'
}],
this.callParent();
});
Ext.define('gridform', {
extend:'Ext.grid.Panel',
alias:'widget.grid',
title:'sample',
store:Ext.data.StoreManager.lookup('samplestore'),
this.editing = Ext.create('Ext.grid.plugin.CellEditing');
columns: [
{header: 'Name', dataIndex:'uname'},
{header: 'Email', dataIndex:'email'},
{header: 'Password', dataIndex:'passw'}],
this.callParent();
});
Ext.create('Ext.data.Store', {
storeId:'samplestore',
fields:['uname','email','passw'],
data:{'items': [{'uname':'zz', 'email':'yy', 'passw':'zzz'},
{'uname':'c', 'email':'b', 'passw':'a'}]}
});
Ext.onReady(function(){
var main = Ext.create('Ext.container.Container', {
padding: '0 0 0 20',
width: 500,
height: 450,
renderTo: document.body,
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
itemId: 'ej',
xtype: 'form',
height: 150,
margins: '0 0 10 0',
},{
itemId: 'grid',
xtype: 'grid',
height: 150,
margins: '0 0 10 0',
}]
});
});
this is my index.html code:
<html>
<head>
<title>Hello Ext</title>
<link rel="stylesheet" type="text/css" href="extjs/ext-4.0.7-gpl/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-4.0.7-gpl/ext-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>
what exactly am i missing??? please help..
this is my app.js code:
Ext.define('registration',
{
extend:'Ext.form.Panel',
alias: 'widget.form',
title:'Form',
defaultType:'textfield',
items: [{
fieldLabel: 'Name',
name:'name',
allowBlank:false
},{
fieldLabel:'Email',
name:'mail',
allowBlank:false,
vtype:'mail'
},{
fieldLabel:'Password',
inputType:'password',
name:'pass',
allowBlanl:false
},{
xtype:'button',
text:'Submit',
//handler:'blank.php'
}],
this.callParent();
});
Ext.define('gridform', {
extend:'Ext.grid.Panel',
alias:'widget.grid',
title:'sample',
store:Ext.data.StoreManager.lookup('samplestore'),
this.editing = Ext.create('Ext.grid.plugin.CellEditing');
columns: [
{header: 'Name', dataIndex:'uname'},
{header: 'Email', dataIndex:'email'},
{header: 'Password', dataIndex:'passw'}],
this.callParent();
});
Ext.create('Ext.data.Store', {
storeId:'samplestore',
fields:['uname','email','passw'],
data:{'items': [{'uname':'zz', 'email':'yy', 'passw':'zzz'},
{'uname':'c', 'email':'b', 'passw':'a'}]}
});
Ext.onReady(function(){
var main = Ext.create('Ext.container.Container', {
padding: '0 0 0 20',
width: 500,
height: 450,
renderTo: document.body,
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
itemId: 'ej',
xtype: 'form',
height: 150,
margins: '0 0 10 0',
},{
itemId: 'grid',
xtype: 'grid',
height: 150,
margins: '0 0 10 0',
}]
});
});
this is my index.html code:
<html>
<head>
<title>Hello Ext</title>
<link rel="stylesheet" type="text/css" href="extjs/ext-4.0.7-gpl/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-4.0.7-gpl/ext-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>
what exactly am i missing??? please help..