1. 전역 함수 정의하기


-> app.js 파일 안에서 정의한다.


function myGlobalFunction() {

}



2. 로딩 완료시에 함수 호출하기


-> app.js 파일 안에서 정의한다.


document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {

}



3. 스플래시 화면 변경하기


-> index.html 파일안에 css로 되어있는 부분을 수정한다.



4. 로그 출력하기


console.log('Print this');



5. 팝업 메세지 출력하기


alert("Hello");



6. 한글 출력 문제 해결


-> 한글이 제대로 출력되지 않을 경우, UTF-8(BOM 없음)으로 저장하여야 한다 (Notepad++ 등 사용)



7. View 배경 색상 변경하기


-> View 정의 시에 style로 지정한다.


Ext.define('projectname.view.ViewName', {

    extend: 'Ext.Container'
    ,config: {
        layout: { type: 'default' }
        ,style: 'background-color: #0000FF'

        ...


혹은 css로 지정




테스트한 버전 : 2.3.1

,
프로퍼티 쓰기:

window.localStorage.setItem(key, value);



프로퍼티 읽기:


var value = window.localStorage.getItem(key);




* 테스트한 버전 : 2.9.0

,

Textfield가 아래와 같이 정의되어있을 경우,


{
    xtype: 'textfield'
    ,id: 'myTextField'
}



입력값 읽기:


Ext.getCmp('myTextField').getValue();



입력값 쓰기:


Ext.getCmp('myTextField').setValue(size);




테스트한 버전 : 2.3.1

,

.my-transparent-button {
    background-color: transparent !important;
    background-image: none !important;
    border-color: transparent;
    border: none;

    color: #FFFFFF;
}



버튼에 적용하기 :


{
    xtype: 'button'
    ,text: 'my button'
    ,cls: 'my-transparent-button'
    ,baseCls: 'my-transparent-button'
    ,pressedCls: 'my-transparent-button-pressed'
}


my-transparent-button-pressed는 버튼이 눌렸을 때 적용되며 color 속성값을 다르게 해서 만들어준다.




* 테스트한 버전 : Sencha Touch 2.3.1

,

1. 개인 css 파일을 다음 경로에 생성한다.


resources/css/my_css.css


2. app.json 파일에 개인 css 파일을 등록한다.


    "css": [
        {
            "path": "resources/css/app.css",
            "update": "delta"
        },
        {
            "path": "resources/css/my_css.css",
            "update": "delta"
        }
    ],




* 적용 버전 : Sencha Touch 2.3.1

,