SNOWFLAKES DRAWING PAPER

[ST2] Sencha Touch Hello World 본문

개발/Sencha Touch

[ST2] Sencha Touch Hello World

눈송2 2012. 7. 16. 18:36

Sencha Touch Hello World

 

 

이전 환경

- JDK 설치 ( http://www.oracle.com/technetwork/java/javase/downloads/index.html )

- 톰캣 서버 다운로드( http://tomcat.apache.org/download-60.cgi )

- 이클립스 설치 ( http://www.eclipse.org/downloads/ )

 

1. Sencha Touch SDK 다운로드 ( http://www.sencha.com/products/touch/download/ > Open Source에 download )

 

2. Eclipse에 Dynamic Web Project 생성

 - new Folder "st2"

 - st2 하위에 sdk 압축풀기

 

3. 아래 소스 생성

 

 test.html                                                                                                     

<!doctype html>
<html>
<script src="st2/sencha-touch.js"></script>
<script src="js/commonInclude.js"></script>
<script src="js/initInclude.js"></script>
<script>

/*
function onReady() {
 log("onReady");
 //makeUI();
}
*/

function createChild() {
 log("createChild");
 var cfgApp = {};
 cfgApp.launch = appLaunch;
 Ext.application(cfgApp);
}

function appLaunch() {
 log("appLaunch");
 Ext.create('Ext.Panel',{fullscreen:true,html:"hello world!"});
}

createChild();

</script>
</html>

 

 js/initInclude.js                                                                                        


Ext.Loader.setPath({
    'Ext': 'st2/src'
});

/*
var configObj = {};
configObj.onReady = onReady;

function onReady() {
 document.write("<br><br>Hello World!!");
}

Ext.setup(configObj);
 */

 

 js/commonInclude.js                                                                               

 

function log(msg)
{
 console.log(msg);
}

 

 

 

 

 

 

Comments