PDA

View Full Version : new on sencha please help



m400mail
24 Nov 2011, 2:22 AM
hallo all,
i am a developer for IBM System i (old name AS/400) and i am new by sencha

i working on the tutorial
http://docs.sencha.com/ext-js/4-0/#!/guide/application_architecture (http://docs.sencha.com/ext-js/4-0/#%21/guide/application_architecture)
MVC Application Architecture

i have created the folders , the app.js,index.html and the file user.js
here the examples

<html>
<head>
<title>Application 01 Sample</title>

<link rel="stylesheet" type="text/css" href="EXT40/resources/css/ext-all.css">

<script type="text/javascript" src="EXT40/ext-all-debug.js"></script>

<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>


Ext.application({
name: 'APP01',
appFolder: 'app',
controllers: ['User'],


// Start function ( Beginn )
launch: function() {

Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [
{
xtype: 'panel',
title: 'User liste als Demo',
html : 'List of users will go here'
}
]
});
}
});


// control for panel
// Die Function onPanelRendered wird aufgerufen bevor die
// Application geladen ist

Ext.define('APP01.controller.User', {
extend: 'Ext.app.Controller',

init: function() {
this.control({
'viewport > panel': {
render: this.onPanelRendered
}
});
},

onPanelRendered: function() {
console.log('da sind wir ja mal gespannt');
}
});


by running this example
the browser becoms the following error:

uncaught exception: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: APP01.controller.User

What can i do ?

KingWarin
24 Nov 2011, 2:57 AM
Hey,

starting up with the mvc i had the same problem.
For now I just added


<script type="text/javascript">
// configure the dynamic class loader
Ext.Loader.setConfig({
enabled: true,
paths: {'com':'com'}
});
</script>

to the index.html before the app.js is loaded, which works fine (and should work for you too!)

AFAIK you have to configure the Ext.Loader manually when using "ext-all-debug.js", another solution is using "bootstrap.js" instead of the ext-all-debug! If all your directory structure is set up correct using bootstrap will work out fine!

So long
Sven

m400mail
24 Nov 2011, 3:48 AM
Hi Sven,

okay now it works
i have changed the index.html

<html>
<head>
<title>Application 01 Sample</title>

<link rel="stylesheet" type="text/css" href="EXT40/resources/css/ext-all.css">

<script type="text/javascript" src="EXT40/ext-all-debug.js"></script>

<script type="text/javascript">
// configure the dynamic class loader
Ext.Loader.setConfig({
enabled: true,
paths: {'APP01':'controller'}
});
</script>


<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>

can we write in german language ? (per mail )
my english are not the best

Thanks
michael