可以't点击Sencha中的按钮
Can't tap button in Sencha
我正在使用Sencha Touch开发一个移动应用程序。问题是我的按钮在我点击后没有切换到新的视图。
我的代码:
查看/登录用户名.js
Ext.define('RibMobile.view.LoginUsername', {
extend: 'Ext.form.Panel',
xtype: 'loginusernamepage',
requires: ['Ext.form.FieldSet', 'Ext.form.Password', 'Ext.Label',
'Ext.Img'
],
config: {
title: 'Login',
items: [{
/* ? */
}, {
xtype: 'button',
itemId: 'nextButton',
ui: 'action',
padding: '10px',
text: 'Next'
}, {
/* ? */
}]
}
});
控制器/Login.js
Ext.define('RibMobile.controller.Login', {
extend: 'Ext.app.Controller',
config: {
refs: {},
control: {
nextButton: {
// On the tap event, call onNewTap
tap: 'onPasswordTap'
}
}
},
//called when the Application is launched, remove if not needed
launch: function(app) {},
onPasswordTap: function() {
// When the user taps on the button, create a new reference of our New view, and set it as the active
// item of Ext.Viewport
Ext.Viewport.setActiveItem(Ext.create('RibMobile.view.LoginPassword'));
}
});
app.js
Ext.application({
name: 'RibMobile',
requires: [
'Ext.MessageBox'
],
controllers: [ 'Main', 'Login' ],
views: [
'Contact',
'Locate',
'LoginUsername',
'LoginPassword',
'Main',
'Promotion'
],
/* ? */
我怎样才能按下按钮?
您错过了按钮与其控件之间的映射。
添加一个引用,它应该可以工作:
refs: {
nextButton: 'button[itemId=nextButton]'
}
相关文章:
- Sencha禁用按钮和Selenium Web驱动程序
- Sencha Touch使一个简单的按钮工作
- 如何更改Sencha Touch中按钮的尺寸
- 可以't点击Sencha中的按钮
- 如何使我的Sencha Touch 2按钮成为矩形
- 以编程方式按下 Sencha Touch 按钮的 Greasemonkey 脚本
- Sencha触摸2分段控制检查按下了哪个按钮
- 在sencha触摸应用程序中的动态分段按钮中设置宽度
- 更改SENCHA TOUCH 2中按钮的图标类
- 如何保持Sencha Ext.Msg关闭按钮点击
- Sencha Touch 2:带按钮的消息框:如何垂直对齐按钮
- Sencha Touch:点击按钮显示日期选择器字段
- Sencha Touch 2:点击没有按钮的Ext.Msg.show
- Sencha触摸-电子邮件按钮
- 当我在sencha touch中从另一个视图点击后退按钮时,没有导航到叶节点
- Sencha触摸2:谷歌+登录按钮在html
- 如何在文本框中显示一个值,点击"done"在sencha触摸中选择器字段中的按钮
- Sencha Touch 2:一个简单的处理HTML按钮显示在面板内给出未定义的错误
- 如何改变sencha触摸中按钮的按下状态
- 我怎么能覆盖文本的日期icker's按钮在extjs(sencha)