Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs 5. Ext.application is not a function. Why?

Tags:

extjs

extjs5

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?

like image 637
Jacobian Avatar asked Jul 30 '14 13:07

Jacobian


People also ask

Is ExtJS single page application?

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.

What is use of ext onReady () function?

Ext. onReady() means wait til the DOM is ready and all required classes are loaded.

What is Ext app?

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.

What is requires ExtJS?

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".


1 Answers

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.

like image 187
Thomas Lauria Avatar answered Oct 29 '22 20:10

Thomas Lauria