Sencha index.html 간단하게 만들기

2024. 12. 15. 19:08Javascript/Sencha

index.html: app.js를 호출

<!DOCTYPE HTML>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=yes">

    <title>Home</title>
	<link rel="stylesheet" type="text/css" href="/resources/classic/theme-classic/resources/theme-classic-all.css">
    <script type="text/javascript" src="/resources/js/ext-all.js"></script>
    <script type="text/javascript" src="/resources/js/packages/charts/classic/charts.js"></script>
    <script type="text/javascript" src="/resources/js/util.js"></script>
    <script type="text/javascript" src="/resources/js/app.js"></script>
</head>
<body>
	<div th:id="${_csrf.parameterName}" th:text="${_csrf.token}" style="display:none"></div>
</body>
</html>

app.js
Application.js를 호출
mainView 지정

Ext.application({
    extend: 'Home.Application',

    name: 'Home',

    requires: [
        // This will automatically load all classes in the Home namespace
        // so that application classes do not need to require each other.
        'Home.*'
    ],

    // The name of the initial view to create.
    mainView: 'Home.view.main.Main'
});

Application.js

Ext.define('Home.Application', {
    extend: 'Ext.app.Application',

    name: 'Home',

    // Load any required classes
    requires: [
        'Home.view.main.Main'
    ],

    // Application launch logic
    launch: function () {
        console.log('Application launched');
    }
});