Hello,
I have a navigation view containing a simple view. I have a button "Next" in the navigation bar which push new simple view using his xtype. This new view have a simple button with an id. I have a controller which on this button tap execute an Ext.Msg.alert. This works on the first try, but when i come back on the first page, then come back again on the 2nd and finally repress the button, nothing appears. the event seems to be ignored.
Here 4 simple classes which reproduce my app :
Code:
Ext.define('Test.controller.Test', { extend: 'Ext.app.Controller',
config: {
refs: {
container: 'main',
nextBtn: '#next_btn',
alertBtn: '#alert_btn',
},
control: {
nextBtn: {
tap: 'onNextBtnTap'
},
alertBtn: {
tap: 'onAlertBtnTap'
},
}
},
onNextBtnTap : function() {
this.getContainer().push({
xtype: 'page_2',
title: 'step 2/2'
});
},
onAlertBtnTap : function() {
Ext.Msg.alert('alert btn pressed');
},
});
Code:
Ext.define('Test.view.Main', { extend: 'Ext.navigation.View',
alias: 'widget.main',
xtype: 'main',
requires: [
'Test.view.Page1'
],
config: {
navigationBar: {
items: [
{
xtype: 'button',
id: 'next_btn',
ui: 'forward',
text: 'OK',
align: 'right'
}
]
},
items: [
{
xtype: 'page_1'
}
]
},
});
Code:
Ext.define('Test.view.Page1', { extend: 'Ext.form.Panel',
alias: 'widget.page_1',
config: {
title: 'step 1',
html: "step 1"
},
});
Code:
Ext.define('Test.view.Page2', { extend: 'Ext.form.Panel',
alias: 'widget.page_2',
config: {
title: 'step 2',
items: [
{
xtype: 'button',
margin: '10 0 0 0',
text: 'alert',
id: 'alert_btn'
},
]
},
});
I'm using a similar navigation in the app i am working on, having 5 views in the wizard. My second problem is that on Iphone, using latest cordova, when i reach the 2nd view the back button have a bigger size than usual (like 30% of the navbar width). I didnt even touched the button but still it's bigger, and when i go on the 3rd page which have normal button and come back (so pop the 3rd), the button of the 2nd suddently just come back to normal size.
Any idea what is happend and how to resolve these isues please?