I'm tring to create an application using extjs5 without the tool senchaCMD. But ext didn't execute the launch function as it does in extjs4.2, and the viewport itsn't rendered, not quite sure why. And wrapping the Ext.application in Ext.onReady also didnt working. Below are my files:
index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Hello Extjs5</title>
<link rel="stylesheet" type="text/css" href="resources/ext-theme-neptune/5.0.1/ext-theme-neptune-all.css">
</head>
<body>
</body>
<script type="text/javascript" src="resources/extjs-gpl/5.0.1/ext-all.js"></script>
<script type="text/javascript" src="app.js"></script>
</html>
app.js
Ext.application({
name: 'SimpleApp',
extend : 'SimpleApp.Application',
autoCreateViewport : 'SimpleApp.view.main.Main'
});
Application.js
Ext.define('SimpleApp.Application', {
extend : 'Ext.app.Application',
name : 'SimpleApp',
controllers : [ 'Root' ],
paths : {
'SimpleApp' : 'app',
'Ext.ux' : 'resources/extjs-gpl/5.0.1/ux'
},
onBeforeLaunch : function() {
debugger;
this.callParent();
},
launch : function() {
debugger;
}
});
Main.js
Ext.define('SimpleApp.view.main.Main', {
extend : 'Ext.container.Container',
plugins : 'viewport',
xtype : 'app-main',
layout : {
align : 'stretch',
type : 'vbox'
},
items : [ {
xtype : 'container',
layout : {
align : 'stretch',
type : 'hbox'
},
flex : 1,
items : [ {
xclass : 'panel',
title : 'p1',
flex : 1,
margins : 5
}, {
xclass : 'panel',
title : 'p2',
flex : 1,
margins : 5
} ]
}, {
xtype : 'container',
layout : {
align : 'stretch',
type : 'hbox'
},
flex : 1,
items : [ {
xclass : 'panel',
title : 'p1',
flex : 1,
margins : 5
}, {
xclass : 'panel',
title : 'p2',
flex : 1,
margins : 5
} ]
} ]
});
Thanks very much!