I get an error in console: Ext.application is not a function
. My index.html
file contains this code:
...
<link rel="stylesheet" type="text/css" href="/ext-5.0.1/packages/ext-theme-neptune/build/resources/ext-theme-neptune-all.css" />
<script src="/ext-5.0.1/ext-all-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
...
While app.js
has just this code, taken from one demo:
Ext.application({
name: 'AM',
appFolder: 'app',
launch: function() {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [{
xtype: 'panel',
title: 'Users',
html : 'List of users will go here'
}]
});
}
});
EDIT
By the way, even running "official" /ext-5.0.1/examples/app/simple/simple.html
I get the same error. Why is that?
Ext JS by Sencha is becoming the ExtJS is a rich, compelling and intuitive open source framework best suited for building single page applications. It offers very rich set of UI components and thus giving a tough competition to other JavaScript frameworks like AngularJS or ReactJS.
Ext. onReady() means wait til the DOM is ready and all required classes are loaded.
Summary. Represents an Ext JS application, which is typically a single page app using a Viewport. An application consists of one or more Views. The behavior of a View is managed by its corresponding Ext. app.
You can look at requires as a way to tell ExtJS: "When you construct an object of this class, please make sure to dynamically load the required scripts first".
Instead of
<script src="/ext-5.0.1/ext-all-debug.js"></script>
You should use
<script src="/ext-5.0.1/build/ext-all-debug.js"></script>
The second one contains all Components and Classes as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With