我在容器中有一个文本(请参阅下面的代码)。当用户点击该文本时,应该显示另一个视图。我再次检查了Sencha文档,我发现Ext.Container没有tap事件。
所以,我的问题是:我是应该显示一个按钮(并在css样式上工作,这样就没有边框等等),并且它是有点击事件,还是有一个更好的方法来解决这个简单的问题?
{
xtype: 'container',
cls: 'myClass',
html: 'go to another view'
},
谢谢。
发布于 2013-07-24 14:28:43
可以在初始化时将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' });
});
}
}
}
https://stackoverflow.com/questions/17836839
复制相似问题