我的导航有问题,我的页面如下所示:
Ext.define('MyApp.view.MeinView', {
extend: 'Ext.navigation.View',
config: {
items: [
{
xtype: 'formpanel',
title: 'MyApp',
id: 'StartAnsicht',
items: [
{
xtype: 'list',
docked: 'top',
height: 200,
ui: 'round',
itemTpl: [
'<div>{titel}: {inhalt}</div>'
],
store: 'EintragStore'
},
{
xtype: 'button',
docked: 'bottom',
id: 'NeuerEintrag',
itemId: 'mybutton1',
ui: 'action',
text: 'New'
}
]
}
],
listeners: [
{
fn: 'onNeuerEintragTap',
event: 'tap',
delegate: '#NeuerEintrag'
}
]
},
onNeuerEintragTap: function(button, e, eOpts) {
this.push(Ext.create("MyApp.view.AddAnsicht", {
title: "New Item"
}));
}
});
和:
Ext.define('MyApp.view.AddAnsicht', {
extend: 'Ext.form.Panel',
config: {
id: 'AddAnsicht',
items: [
{
xtype: 'button',
docked: 'bottom',
id: 'NeuSubmit',
itemId: 'mybutton',
ui: 'confirm',
text: 'Add'
}
],
listeners: [
{
fn: 'onNeuSubmitTap',
event: 'tap',
delegate: '#NeuSubmit'
}
]
},
onNeuSubmitTap: function(button, e, eOpts) {
var inhalt = Ext.getStore('EintragStore');
inhalt.add({ inhalt: '1', titel: '2' });
inhalt.sync();
this.push(Ext.create("MyApp.view.MeinView"));
}
});
问题:当我到达第二面并单击按钮时,我得到:
Uncaught TypeError: Object [object Object] has no method 'push'
如何避免这种情况?