Hi,
I wonder if it is possible to use Ext.Application and with the dynamic Class-Loader to load the Views, Modells and Controllers.
I have made some experiments, but I wasn't able to solve all Problems:
index.html
PHP Code:
<link rel="stylesheet" type="text/css" href="./lib/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="./lib/ext/bootstrap.js"></script>
<script type="text/javascript">
Ext.Loader.setConfig({
enabled: true,
paths: {'app':'app'}
});
</script>
<script type="text/javascript" src="./app/app.js" ></script>
app/app.js
Code:
Ext.define('app', {
extend: 'Ext.Application',
requires: ['app.views.Viewport'],
name: 'app',
//Ext is crashing because there is no Ext.Viewport.init() function at the moment (ext4-pr5)
autoInitViewport:false,
launch: function() {
this.views.viewport = new app.views.Viewport();
}
},
function(){
Ext.regApplication(new app());
});
app/views/Viewport.js
Code:
Ext.define('app.views.Viewport', {
extend: 'Ext.Panel',
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
initComponent: function() {
//[...]
app.views.Viewport.superclass.initComponent.apply(this, arguments);
}
});
Has someone any ideas, how it is possible to load the view dynamically?