I'm a newbie on sencha-ExtJs and I was trying to understand how it works by setting a test application.
First this is my app architecture:
/senchatestapp/ <--- here i have all my app files
/sencha/
/controller/
/model/
/view/
login.js
/store/
/extjs/ <---- here i have my sencha library files
ext-all.js
/resources/
/css/
ext-all.css
app.js
index.html
These are my files content:
app.js:
Ext.application({
name: 'Senchatest',
appFolder: 'sencha',
launch: function() {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
renderTo: Ext.getBody(),
items: [
{
xtype: 'loginview'
}
]
});
}
});
login.js:
Ext.define('Senchatest.view.Login', {
extend: 'Ext.grid.Panel',
height: 130,
width: 280,
bodyPadding: 10,
alias : 'widget.loginview',
initComponent: function() {
this.items = [
{
xtype: 'form',
items: [
{
xtype: 'textfield',
name : 'login',
fieldLabel: 'Login'
},
{
xtype: 'textfield',
name : 'pwd',
fieldLabel: 'pwd'
}
]
}
];
this.buttons = [
{
text: 'Ok'
}
];
this.callParent(arguments);
}
});
And finally my index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>sencha test</title>
<link rel="stylesheet" type="text/css" href="ext-js/resources /css/ext-all.css">
<script type="text/javascript" src="ext-js/ext-all.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
</body>
</html>
I put the app folder in tomcat/webapps/ directory.
When I launch the app I'm just getting a blank page nevertheless app.js should have request the view to render on the <body> tag.
I just want the view to be rendered, nothing else for the moment (nothing about controlling or read/sending data etc.).
I don't know where I made a mistake or what I'm not understanding but I'll be very happy to get this solved.