-
Ext.Loader to production
My understanding is that when I want to go to production I use:
Code:
Ext.Loader.setConfig({
enabled: false
});
However I get this error:
Uncaught Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically.
Here is my HTML, what am I doing wrong:
Code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title id="page-title">testApp</title>
<link rel="stylesheet" type="text/css" href="js_lib/sencha_touch/resources/css/sencha-touch.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js_lib/sencha_touch/sencha-touch-all.js"></script>
<script type="text/javascript" src="app/app.js"></script>
</head>
<body>
</body>
</html>
-
In production, Ext.Loader shouldn't be used. Throughout developing it should be.
-
I still get errors
I even tried taking it out completely and I get this error:
Uncaught Error: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required classes: testApp.controller.LoginController, testApp.controller.LanguageController
Here is my app.js
Code:
/*Ext.Loader.setConfig({
enabled: true
});
Ext.Loader.setPath('testApp','app');
Ext.require([
'Ext.XTemplate',
'Ext.Panel',
'Ext.Button',
'Ext.List',
'Ext.Map',
'Ext.data.Store'
]);*/
Ext.application({
name: 'testApp',
controllers: ['testApp.controller.LoginController', 'testApp.controller.LanguageController'],
launch: function() {
var viewport = Ext.create('Ext.Panel', {
fullscreen: true,
id:'mainViewport',
layout: 'card',
activeItem: 0,
items: [
{xtype: 'LoginForm'},
{xtype: 'LanguageList'}
],
});
}
});
If I uncomment all the Ext.Loader stuff it works fine.
-
If ST 2.x is like ExtJS 4.x then you have to download the SDK Tools and use that to do a custom build. You then replace your sencha-touch-all.js and app.js references with an app-all.js file that gets built.
-
So you have disabled Loader and you are getting the error that dependancies are not able to be resolved. This means that you have not setup your requires/uses properties on your application files correctly and then used SDK Tools to create a custom build.
-
Example
Can you please provide an example on where to use the requires/uses properties? I am looking at the docs right now in Application and Controllers but do not see these properties?
Thank you for all the help!
-
search for requires in the kitchensink example... Kitchensink.view.Audio has one... Kitchensink.view.Carousel has one...