sencha에 외부 js 파일 import 하기

2024. 7. 27. 09:07Javascript/Sencha

index.html 파일에 import하면 됨

<!DOCTYPE HTML>
<html manifest="">
<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>
    # 외부 스크립트 추가
    <script type="text/javascript" src="/js/util.js"></script>
    
    <script type="text/javascript">
        var Ext = Ext || {
			theme: {
				name: 'aklsfd'
			}	
		}; // Ext namespace won't be defined yet...

        // This function is called by the Microloader after it has performed basic
        // device detection. The results are provided in the "tags" object. You can
        // use these tags here or even add custom tags. These can be used by platform
        // filters in your manifest or by platformConfig expressions in your app.
        //
        Ext.beforeLoad = function (tags) {
            var s = location.search,  // the query string (ex "?foo=1&bar")
                profile;

            // For testing look for "?classic" or "?modern" in the URL to override
            // device detection default.
            //
            if (s.match(/\bclassic\b/)) {
                profile = 'classic';
            }
            else if (s.match(/\bmodern\b/)) {
                profile = 'modern';
            }
            else {
                profile = tags.desktop ? 'classic' : 'modern';
                //profile = tags.phone ? 'modern' : 'classic';
            }

            Ext.manifest = profile; // this name must match a build profile name

            // This function is called once the manifest is available but before
            // any data is pulled from it.
            //
            //return function (manifest) {
                // peek at / modify the manifest object
            //};
			//Ext.theme.name = 'aasfdsdaf';
        	//alert(Ext.theme.name);
        };

    </script>

    <!-- The line below must be kept intact for Sencha Cmd to build your application -->
    <script id="microloader" data-app="392a3236-e9a9-4ed7-9d93-2f79da30897f" type="text/javascript" src="bootstrap.js"></script>
</head>
<body>
</body>
</html>

util.js

function test() {
	alert();
}

호출

{
	text: 'Login',	
	handler: function() {
		test();
	}
}

'Javascript > Sencha' 카테고리의 다른 글

Ext.form.Panel 설정  (0) 2024.08.03
Sencha post 방식으로 데이터 전송시, 동적으로 파라메터 추가  (0) 2024.07.27
Main을 원하는 대로 변경  (0) 2024.07.21
theme css 파일 위치  (0) 2024.07.16
Ext에 property 추가  (0) 2024.07.16