I'm working in Sencha Touch framework, and want to design a navigation bar to push my additional views. However, I want to add either my cardlayout
(eg: xtype: 'mycard'
) or a widget (eg: xtype: 'my'
).
How can I push my existing view which is already defined as Ext.define('MyProject.view.my', {//some deination})
. I tried the following code but unable to call in my handler
function when the button pressed in navigation bar.
I'm absolutely unable to push
any view as it is not working in my handler
function, and unable to call the view.push
.
How can I get my view and push as a navigation item?
Tried Code for push some view:
//create the navigation view and add it into the Ext.Viewport
var view = Ext.Viewport.add({
xtype: 'navigationview',
//we only give it one item by default, which will be the only item in the 'stack' when it loads
items: [{
//items can have titles
title: 'Navigation View',
padding: 10,
//inside this first item we are going to add a button
items: [{
xtype: 'button',
text: 'Push another view!',
handler: function () {
//when someone taps this button, it will push another view into stack
view.push({
//this one also has a title
title: 'Second View',
padding: 10,
//once again, this view has one button
items: [{
xtype: 'button',
text: 'Pop this view!',
handler: function () {
//and when you press this button, it will pop the current view (this) out of the stack
view.pop();
}
}]
});
}
}]
}]
});
My Code:
{
xtype: 'button',
text: 'btn',
id: 'btn1',
scope: this,
handler: function(b, e) {
//here I want to push my view named as xtype: 'my'
// my main viewport has the xtype: 'main' and alias: 'widget.mypanel'
}
}