sench touch 页面跳转
下面是我做的一个简单的登录页面登录成功后跳转页面
首页要在app.js 里面添加
1.视图层 登录页面
Ext.define('MyApp.view.Login', {
extend: 'Ext.form.Panel',
requires:['Ext.Img','Ext.field.Password'],
alias: 'widget.Login',
xtype: 'Login',
config: {
fullscreen: true,
cls:'Login',
items: [
{
margin: 20,
html:'<p class="login-title">登录</p>'
},
{
margin: '20px',
style: 'border-bottom:1px solid #f5f5f5;border-radius:0;color:#fff;',
xtype: 'textfield', //文本框
name: 'username',
id:"username",
placeHolder: '账号',
required: true, //必填字段
ClearIcon: true //输入内容后文本框后面会出现一个清空按钮
},
{
margin: '20px',
style: 'border-bottom:1px solid #f5f5f5;border-radius:0;color:#fff;',
xtype: 'passwordfield', //密码文本框
name: 'password',
id:"password",
placeHolder: '密码',
required: true,
ClearIcon: true
},
{
margin: '20px',
html:'<div class="remPassword"><input id="remPassword" type="checkbox"><label for="remPassword">记住密码</label></div>'
},
{
xtype: 'button',//添加一个登录按钮,
text: '登录',
cls:'LoginBtn'
}
]
}
});
2.controller login
Ext.define('MyApp.controller.Login', {
extend: 'Ext.app.Controller',
config: {
refs: {
'addButton': 'Login button' //找到按钮
},
control: {
addButton: {
tap: 'loginBtn' //为按钮添加方法
}
}
},
loginBtn:function(){
var username = Ext.getCmp('username').getValue();
var password = Ext.getCmp('password').getValue();
if (username === "") {
Ext.Msg.alert("提示", "用户名不许为空!");
return;
}
if (password === "") {
Ext.Msg.alert("提示", "密码不许为空!");
return;
}
Ext.Msg.alert("提示", username + " 登录成功!"); Ext.Viewport.setActiveItem(
'main', { //main 为要跳转的页面
type : 'slide',
direction : 'right'
});
}
});
3.登录按钮 登录成功后跳转到的页面 视图层 首页
Ext.define('MyApp.view.Main', {
extend: 'Ext.tab.Panel',
xtype: 'main',
requires: [
'Ext.tab.Panel'
],
config: {
tabBarPosition: 'bottom',
items: [
{
title: '首页',
iconCls: 'home',
items:[
{
html:'哈哈'
},
{
html:'哈哈'
},
{
html:'哈哈'
}
]
},
{
title: '搜索',
iconCls: 'search',
html:'搜索'
},
{
title: '商城',
iconCls: 'add',
html:'分类'
},
{
title: '我的',
iconCls: 'user',
html:'我的'
}
]
}
});
sench touch 页面跳转的更多相关文章
- [Xcode 实际操作]九、实用进阶-(23)多个Storyboard故事板中的页面跳转
目录:[Swift]Xcode实际操作 本文将演示多个Storyboard故事板中的页面跳转. 使用快捷键[Command]+[N]创建一个新的故事板文件. (在项目文件夹[DemoApp]上点击鼠标 ...
- [Xcode 实际操作]九、实用进阶-(24)使用Segue(页面的跳转连接)进行页面跳转并传递参数
目录:[Swift]Xcode实际操作 本文将演示使用Segue(页面的跳转连接)进行页面跳转并传递参数. 参照结合:[Xcode10 实际操作]九.实用进阶-(23)多个Storyboard故事板中 ...
- JSP页面跳转的几种实现方法
使用href超链接标记 客户端跳转 使用JavaScript 客户端跳转 提交表单 客户端跳转 使用response ...
- web设计页面跳转的方法
一.asp.net c# 打开新页面或页面跳转 1. 最常用的页面跳转(原窗口被替代):Response.Redirect("newpage.aspx"); 2. 利用url地址打 ...
- 前端开发--ppt展示页面跳转逻辑实现
1. 工程地址:https://github.com/digitalClass/web_page 网站发布地址: http://115.28.30.25:8029/ 2. 今天遇到一个小问题, 同组的 ...
- Html中设置访问页面不在后进行其他页面跳转
Html中设置访问页面不在后进行其他页面跳转 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" & ...
- JS打开新页面跳转
有时候使用js进行页面跳转,想使用 a 标签中 target="_blank" 形式,跳转打开一个新的页面. 可以使用以下脚本,创建一个 a标签,然后模拟点击操作. 代码如下: ...
- web页面跳转的几种方式
可用客户端触发或服务端触发的方式来实现页面跳转. 客户端触发 方式一:使用Javascript 利用window.location对象的href属性.assign()方法或replace()方法来实现 ...
- Ajax发送POST请求SpringMVC页面跳转失败
问题描述:因为使用的是SpringMVC框架,所以想使用ModelAndView进行页面跳转.思路是发送POST请求,然后controller层中直接返回相应ModelAndView,但是这种方法不可 ...
随机推荐
- 关于文件I/o的原子操作
[摘自<Linux/Unix系统编程手册>] 所有系统调用都是以原子操作方式执行的.这里是指内核保证了某系统调用中的所有步骤会作为独立操作而一次性执行,其间不会为其它进程或线程所中断. 原 ...
- C#操作xml SelectNodes,SelectSingleNode总是返回NULL
SelectNodes,SelectSingleNode总是返回NULL 原文地址:http://www.cnblogs.com/linlf03/archive/2011/11/30/2268705. ...
- python生成随机日期字符串
python生成随机日期字符串 生成随机的日期字符串,用于插入数据库. 通过时间元组设定一个时间段,开始和结尾时间转换成时间戳. 时间戳中随机取一个,再生成时间元组,再把时间元组格式化输出为字符串 # ...
- nethogs命令执行报异常的解决方法
- 解决 js setTimeout 传递带参数的函数无效果
最近 js 用到 setTimeout 递归调用 刷新进度 setTimeout ("getProgress(name,type)", 3000) ; 发现getProgres ...
- Codeforces 1019C Sergey's problem 构造
原文链接https://www.cnblogs.com/zhouzhendong/p/CF1019C.html 题目传送门 - CF1019C 题意 给定一个有 $n$ 个节点 . $m$ 条边的有向 ...
- Substrings kmp
Problem Description You are given a number of case-sensitive strings of alphabetic characters, find ...
- 069 在SparkStreaming的窗口分析
一:说明 1.图例说明 ---------------------------------------------------------------------------------------- ...
- Git branch 出现"HEAD detached at head xxxxx"
Git branch 出现"HEAD detached at head xxxxx" git branch <your-branch-name> xxxxx ...
- android studio使用CMake和NDK,实现应用自身被卸载时打开某一网址
实现应用自身被卸载时打开某一网址的c代码 MyActivity: public class MyActivity extends Activity { /** * Called when the ac ...