eurosickwitit
17 Oct 2012, 9:53 AM
So, I decided to learn ExtJS starting with version 4 since I am completely new to it.
I have been following the app architecture tutorial here http://docs.sencha.com/ext-js/4-1/#!/guide/mvc_pt2
I want to utilize the same approach where I use the autoCreateViewport: true flag.
Before I start adding things to the interface, I want to make sure it loads. I followed the tutorial carefully and I do not know what I am missing, but the interface is NOT SHOWING in the browser.
Here is my code (very little, I know, but should work and at least show the panel).
This is my app.js file
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'Cache22AccuCons',
appFolder: 'AccuCons',
autoCreateViewport: true,
launch: function () {
//this is fired as soon as the page is ready
}
});
This is my Viewport.js
Ext.define('AccuCons.view.Viewport', {
extend: 'Ext.container.Viewport',
requires: ['AccuCons.view.AccuCoverage'],
layout: 'fit',
autoRender: true,
initComponent: function(){
this.items = {
xtype: 'panel',
};
this.callParent();
}
});
And this is my AccuCoverage.js
Ext.define('AccuCons.view.AccuCoverage', {
extend: 'Ext.panel.Panel',
alias: 'widget.accucoverage',
autoShow: true
});
And this is my index.html
<html><head>
<title>Cache22 - Accuracy Console</title>
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript" src="app2.js"></script>
</head>
<body></body>
</html>
I checked the firebug, all the js files load, and there are no errors in console.
Based on the ext js code, should I not be seeing at least a panel there? I am stuck currently on this, I know how to do this using the approach without autoCreateViewport.
Any insight on this basic stuff I can't figure out and baffles me would be greatly appreciated.
I have been following the app architecture tutorial here http://docs.sencha.com/ext-js/4-1/#!/guide/mvc_pt2
I want to utilize the same approach where I use the autoCreateViewport: true flag.
Before I start adding things to the interface, I want to make sure it loads. I followed the tutorial carefully and I do not know what I am missing, but the interface is NOT SHOWING in the browser.
Here is my code (very little, I know, but should work and at least show the panel).
This is my app.js file
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'Cache22AccuCons',
appFolder: 'AccuCons',
autoCreateViewport: true,
launch: function () {
//this is fired as soon as the page is ready
}
});
This is my Viewport.js
Ext.define('AccuCons.view.Viewport', {
extend: 'Ext.container.Viewport',
requires: ['AccuCons.view.AccuCoverage'],
layout: 'fit',
autoRender: true,
initComponent: function(){
this.items = {
xtype: 'panel',
};
this.callParent();
}
});
And this is my AccuCoverage.js
Ext.define('AccuCons.view.AccuCoverage', {
extend: 'Ext.panel.Panel',
alias: 'widget.accucoverage',
autoShow: true
});
And this is my index.html
<html><head>
<title>Cache22 - Accuracy Console</title>
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript" src="app2.js"></script>
</head>
<body></body>
</html>
I checked the firebug, all the js files load, and there are no errors in console.
Based on the ext js code, should I not be seeing at least a panel there? I am stuck currently on this, I know how to do this using the approach without autoCreateViewport.
Any insight on this basic stuff I can't figure out and baffles me would be greatly appreciated.