私はsencha2.0に取り組んでいます。ログインフォームが1つあり、ログインフォームにある送信ボタンをクリックして別のフォームを呼び出したいのですが、同じカードレイアウトを使用して、1つのフォームがカードの1つのアイテムになり、別のフォームがカードの別のアイテムになります。カード。ロジックについては明確ですが、参照用に同様の種類の例が必要です。同じものを参照するためのいくつかの良い例を教えていただけますか?以下のコードで問題を見つけるのを手伝ってください:
Ext.define('senchaApp.view.activation', {
extend : 'Ext.Container',
xtype : 'activation',
requires: "Ext.form.FieldSet",
id : 'activation',
constructor : function(config) {
var formContainer = Ext.create('Ext.Panel',{
id:'formPanel',
layout:'card',
fullscreen:'true',
items:[{
xtype:'fieldset',
title:'Login',
items:[
{xtype:'textfield',
name:'name',
id:'name',
label:'Name',
clearIcon:false,
cls:'fields'
},
{xtype:'emailfield',
style:'margin-top:10px;',
name:'email',
id:'email',
label:'Email',
clearIcon:false,
cls:'fields'
},
{xtype:'emailfield',
style:'margin-top:10px;',
name:'reTypeEmail',
id:'reTypeEmail',
label:'Retype Email',
clearIcon:false,
cls:'fields'
},
{xtype:'passwordfield',
style:'margin-top:10px;',
name:'pass',
id:'pass',
label:'Password',
clearIcon:false,
cls:'fields'
},
{xtype:'passwordfield',
style:'margin-top:10px;',
name:'reTypePass',
id:'reTypePass',
label:'Retype Password',
clearIcon:false,
cls:'fields'
},
{xtype:'numberfield',
style:'margin-top:10px;',
name:'mobilePhone',
id:'mobilePhone',
label:'Mobile Phone',
clearIcon:false,
cls:'fields'
},
{
xtype:'textfield',
name:'secretQuestion',
id:'secretQuestion',
style:'margin-top:10px;',
label:'Secret Question',
clearIcon:false,
cls:'fields'
},
{
xtype:'textfield',
name:'secretAnswer',
id:'secretAnswer',
label:'Secret Answer',
style:'margin-top:10px;',
clearIcon:false,
cls:'fields',
},
{
xtype:'numberfield',
style:'margin-top:10px;',
name:'authCode',
id:'authCode',
label:'Auth Code',
clearIcon:false,
cls:'fields'
},
{
xtype:'button',
style:'margin-top:10px;float:right;width:10%;',
cls:'next',
id:'next',
text:'Next',
ui:'action-round',
action:'next',
}
]
},
{ xtype:'fieldset',
title:'Activation',
items:[
{
xtype:'textfield',
name:'user',
id:'user',
label:'Username',
clearIcon:false,
cls:'fields'
},
{xtype:'passwordfield',
style:'margin-top:10px;',
name:'pass',
id:'pass',
label:'Password',
clearIcon:false,
cls:'fields'
},
{xtype:'button',
cls:'submitBtn',
id:'submit',
ui:'action-small',
action:'submitLogin',
style:'background-image: url("app/resources/images/img_btnStrip.png");width:186px;margin: 0 auto;height:66px;margin-top:20px;background-color:none;'
}
]
}
]
});
var formContentHolder = Ext.create('Ext.Panel',{
cls:'middleContainer',
items:[formContainer]
});
config.items = [formContentHolder];
this.callParent(arguments);
},
initialize : function() {
this.callParent(arguments);
}
});
以下は、コントローラーの下にあるMain.jsのコードです。
Ext.define('senchaApp.controller.Main',{
extend:'Ext.app.Controller',
init: function(){
Ext.create('senchaApp.view.Viewport');
this.control({
'#submit':{
tap: this.showIndicesOverlay
}
});
},
showIndicesOverlay: function(){
Ext.getCmp('activation').setActiveItem(1);
}
});