자바스크립트/Ext JS2012. 3. 9. 11:14
    
// History.js 의 예
Ext.define("Docs.etc.History", {
    singleton: true,
    init: function () {
    	
        Ext.util.History.init(function () {
        	
            this.historyLoaded = true;		// 최초에 true이고 이후 변경없음.
            this.initialNavigate();
        }, this);
        // 아래는 history가 변경될 때 navigate함수를 호출하라는 내용이다.
        // "이벤트", "호출함수", "인자1", "인자2"
        // 단 인자는 모두 object여야한다.
        Ext.util.History.on("change", this.navigate, this, {'a':'aa'});
    },
    navigate: function (c, d) { // 탭을 클릭하면 history 변경되고 아래를 실행
    	console.log('navigate::', c, d); // 이렇게 확인
    	var d = this.parseToken(c);
    	// loadIndex(true) : true는 왜 ??
    	if (d.url === "#!/guide") {
    		Docs.App.getController("Guides").loadIndex(true);
    	} else {
    		if (d.type === "guide") {
                Docs.App.getController("Guides").loadGuide(d.url, true);
            }
    	}
    }
-


Posted by 베니94