[英]How to navigate to another view when i tapped a button in Sencha touch
[英]Sencha Touch 2: how to make a link to another view?
我在容器中有一个文本(请参见下面的代码)。 当用户点击该文本时,应显示另一个视图。 我再次检查了Sencha文档,发现Ext.Container没有点击事件。
所以,我的问题是:我应该显示一个按钮(并在CSS样式上工作,以便没有边框等),并且它具有tap事件,或者有更好的方法来解决这个简单的问题?
{
xtype: 'container',
cls: 'myClass',
html: 'go to another view'
},
谢谢。
您可以在初始化时向元素添加tap
监听器:
{
xtype: 'container',
cls: 'myClass',
html: 'go to another view',
listeners: {
initialize: function(ct) {
ct.element.on('tap', function() {
Ext.Viewport.add({ xtype: 'other-panel' });
});
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.