다음 응용 프로그램에서 xtype으로 다음 코드를 사용하고 있습니다. 내 목록 항목이 내가 원하는 방식으로 나타나지만 항목을 클릭 할 때마다 데이터가있는 새 페이지를로드해야하는 항목을 클릭 할 때마다이 오류가 발생합니다. Uncaught TypeError : Object function() {h.apply (this , arguments)}에는 'setActiveItem'메서드가 없습니다. 내가 고칠 수있는 방법에 대한 생각은? 언급 된 항목 행은 코드에서 주석 처리됩니다. 여기 Sencha : Uncaught TypeError : Object function() {h.apply (this, arguments)}에 'setActiveItem'메서드가 없습니다.
내 코드입니다 : 몇 가지 조작 후 당신의 도움이에 대한
var AppsBack = new Ext.Toolbar({
dock: 'top',
items: [{
text: 'back',
ui: 'back',
handler: function(){
Home.setActiveItem('home'); //Here is the second problem
}
}]
});
var AppsDetails = new Ext.Panel({
id: "appsdetails",
tpl: "{game}",
dockedItems: [AppsBack]
});
var AppsList = new Ext.List({
id: "appslist",
store: AppsStore,
layout: 'card',
emptyText: "No game found",
itemTpl: "{game}",
listeners: {
itemtap: function(view, index, item, e) {
var rec = view.getStore().getAt(index);
AppsDetails.update(rec.data);
AppsBack.setTitle(rec.data.game);
Home.setActiveItem('appsdetails') //Here is the first problem
}
}
});
var AppsListWrapper = new Ext.Panel({
id: "appslistwrapper",
layout: 'card',
items: [AppsList],
dockedItems: []
});
var Home = Ext.extend(Ext.Panel, {
id: "home",
iconCls: 'home',
title: 'Home',
fullscreen: true,
layout: 'card',
cardSwitchAnimation: 'slide',
initComponent: function() {
Ext.apply(this, {
items: [AppsListWrapper, AppsDetails]
});
Home.superclass.initComponent.apply(this,arguments)
}
});
Ext.reg('appsList', Home);
감사합니다, 나는이기 때문에 나는이 문제가 발생하고 유일한 이유가 있음을 발견했습니다 패널을 확장하려고합니다. 내가 들을 Ext.extend (Ext.Panel의 새로운 Ext.Panel intead를 사용하는 경우 다른 측면에서, {... 모든 작동 잘 내가이 경우에는하기 위해 xtype을 사용할 수 없습니다 제외. 어떤 아이디어?