Navigation 如何在推送时设置另一个视图
这里是我在sencha中的代码。我想从主视图推送一个新视图,html正在工作,但如何添加其他视图而不是htmlNavigation 如何在推送时设置另一个视图,navigation,sencha-touch-2,viewport,Navigation,Sencha Touch 2,Viewport,这里是我在sencha中的代码。我想从主视图推送一个新视图,html正在工作,但如何添加其他视图而不是html Ext.application({ launch: function () { var signinformBase = { standardSubmit : false, items: [ {
Ext.application({
launch: function () {
var signinformBase = {
standardSubmit : false,
items: [
{
xtype: 'fieldset',
scope:this,
defaults: {
required: true,
labelAlign: 'left',
labelWidth: '37%'
},
title: 'Enter your wish',
items: [{
xtype: 'textfield',
name : 'emailid',
label: 'Item Name',
useClearIcon: true
},{
xtype: 'textfield',
name : 'password',
label: 'Description',
useClearIcon: true
},{
xtype: 'textfield',
name : 'Price',
label: 'Price',
useClearIcon: true
},
{
xtype: 'button',
text: 'Add Image',
ui: 'round',
handler: function()
{
}
},{
xtype: 'button',
text: 'Add Location',
ui: 'round',
handler: function()
{
viewport.setActiveItem(0, {type:'fade', direction:'left'});
viewport.setActiveItem({
title: 'Second',
html: 'Second view!'
});
}
}
,{
xtype: 'textfield',
name : 'password',
label: 'Category',
useClearIcon: true
},{
xtype: 'textfield',
name : 'password',
label: 'Location',
useClearIcon: true
}],
},
{
xtype: 'button',
text: 'Done',
ui: 'round',
handler: function()
{
view.push({
title: 'Second',
html: '<font ><h3 style="font-weight:bold"><b>Congratulations!</font></h3><div align="left" style="border: 0px black solid; padding-left:10px;"><br><font>Congratulations! You have successfully signed up for a account. A confirmation email will be sent to your email.</font><br><br></div><br><br><p align="center"><button type="button" onClick="javascript:gomyaccount()" class="button" ><font size="3" face="arial">Next</font></button><p>'
});
},
]
};
var view = Ext.create('Ext.NavigationView', {
fullscreen: true,
items: [
{
title: 'Home',
items: [signinformBase]
}]
});
} // launch
});
Ext.application({
启动:函数(){
var SignInfo数据库={
标准提交:错误,
项目:[
{
xtype:“字段集”,
范围:本,,
默认值:{
要求:正确,
labelAlign:'左',
标签宽度:“37%”
},
标题:“输入您的愿望”,
项目:[{
xtype:'textfield',
名称:'emailid',
标签:“项目名称”,
useClearIcon:true
},{
xtype:'textfield',
名称:“密码”,
标签:“说明”,
useClearIcon:true
},{
xtype:'textfield',
名称:'价格',
标签:“价格”,
useClearIcon:true
},
{
xtype:'按钮',
文本:“添加图像”,
ui:“圆形”,
处理程序:函数()
{
}
},{
xtype:'按钮',
文本:“添加位置”,
ui:“圆形”,
处理程序:函数()
{
setActiveItem(0,{类型:'fade',方向:'left'});
viewport.setActiveItem({
标题:"第二",,
html:“第二视图!”
});
}
}
,{
xtype:'textfield',
名称:“密码”,
标签:'类别',
useClearIcon:true
},{
xtype:'textfield',
名称:“密码”,
标签:'位置',
useClearIcon:true
}],
},
{
xtype:'按钮',
文本:“完成”,
ui:“圆形”,
处理程序:函数()
{
view.push({
标题:"第二",,
html:“祝贺您!
祝贺您!您已成功注册帐户。确认电子邮件将发送到您的电子邮件中。
下一步”
});
},
]
};
var view=Ext.create('Ext.NavigationView'{
全屏:对,
项目:[
{
标题:"家",,
项目:[签名信息数据库]
}]
});
}//发射
});
viewport.setActiveItem(0,{type:'fade',direction:'left'});也不工作,我是sencha的新手。请帮助我解决示例中的视口未定义变量。您可以改用view
{
xtype:'按钮',
文本:“添加位置”,
ui:“圆形”,
处理程序:函数(){
setActiveItem(0,{类型:'fade',方向:'left'});
view.setActiveItem({
标题:"第二",,
html:“第二视图!”
});
}
}
源代码