0
我遇到問題,正在使用下面的應用程序進行一些範圍確定。在我調用this.fireEvent時,我不再限制在我的應用程序中,而是在文檔窗口中。PhoneGap和Sencha touch的範圍問題
任何想法?
DN.App = Ext.extend(Ext.Panel, { initComponent: function() { document.addEventListener("backbutton", this.backKey, true); DN.App.superclass.initComponent.call(this); }, setActivePanel: function(){ //global handler for switching panels }, backKey: function(){ var prev = DN.App.prevPanel[DN.App.prevPanel.length-1]; DN.App.prevPanel.pop(); //This handles the switching of panels, but 'this' is scoped to html document at this point this.fireEvent('setActivePanel',prev); } });
找到答案 呸,我曾在此一對夫婦小時發佈,然後算出它輸出8分鐘後前。我嘗試使用DN.App.fireEvent
但這也沒有奏效。然後我意識到DN.App只是我製作的課程,而不是實際的對象。在另一個文件中,我將其稱爲DNApp = new DN.App();
在看到我試過DNApp.fireEvent
後,它工作得很好。