下面是我做的一个简单的登录页面登录成功后跳转页面

首页要在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 页面跳转的更多相关文章

  1. [Xcode 实际操作]九、实用进阶-(23)多个Storyboard故事板中的页面跳转

    目录:[Swift]Xcode实际操作 本文将演示多个Storyboard故事板中的页面跳转. 使用快捷键[Command]+[N]创建一个新的故事板文件. (在项目文件夹[DemoApp]上点击鼠标 ...

  2. [Xcode 实际操作]九、实用进阶-(24)使用Segue(页面的跳转连接)进行页面跳转并传递参数

    目录:[Swift]Xcode实际操作 本文将演示使用Segue(页面的跳转连接)进行页面跳转并传递参数. 参照结合:[Xcode10 实际操作]九.实用进阶-(23)多个Storyboard故事板中 ...

  3. JSP页面跳转的几种实现方法

    使用href超链接标记      客户端跳转 使用JavaScript               客户端跳转 提交表单                        客户端跳转 使用response ...

  4. web设计页面跳转的方法

    一.asp.net c# 打开新页面或页面跳转 1. 最常用的页面跳转(原窗口被替代):Response.Redirect("newpage.aspx"); 2. 利用url地址打 ...

  5. 前端开发--ppt展示页面跳转逻辑实现

    1. 工程地址:https://github.com/digitalClass/web_page 网站发布地址: http://115.28.30.25:8029/ 2. 今天遇到一个小问题, 同组的 ...

  6. Html中设置访问页面不在后进行其他页面跳转

    Html中设置访问页面不在后进行其他页面跳转 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" & ...

  7. JS打开新页面跳转

      有时候使用js进行页面跳转,想使用 a 标签中 target="_blank" 形式,跳转打开一个新的页面. 可以使用以下脚本,创建一个 a标签,然后模拟点击操作. 代码如下: ...

  8. web页面跳转的几种方式

    可用客户端触发或服务端触发的方式来实现页面跳转. 客户端触发 方式一:使用Javascript 利用window.location对象的href属性.assign()方法或replace()方法来实现 ...

  9. Ajax发送POST请求SpringMVC页面跳转失败

    问题描述:因为使用的是SpringMVC框架,所以想使用ModelAndView进行页面跳转.思路是发送POST请求,然后controller层中直接返回相应ModelAndView,但是这种方法不可 ...

随机推荐

  1. FormsAuthenticationTicket

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  2. 【bzoj4976】宝石镶嵌

    题解: 比较水 注意k<=100这个条件 当n-k比较大的时候 我们显然会把它有的位都给取了 不然的话我们可以考虑dp 暴力状压就可以了 代码: #include <bits/stdc++ ...

  3. 【BZOJ2560】串珠子

    题解: 跟n个点有标号的无向连通图个数几乎一模一样 直接上代码了 代码: #include <bits/stdc++.h> using namespace std; #define ll ...

  4. centos7 查看ip地址

    命令: ip  address 简写ip  a 过滤出来某个网卡的ip: ip a show ens33 |awk -F ' ' 'NR==3{print$2}'|cut -d / -f1

  5. python全栈开发day65-templates:tags、母版和继承、组件、静态文件相关、simple_tag和inclusion_tag

    一.昨日内容回顾 1.MVC和MTV框架 MVC:  model 模型 存写数据   view 视图 给用户展示页面 control 控制器 负责调度 传递指令 MTV: M:model 模型  OR ...

  6. spring开发需要的配置文件

    1,applicationContext-dao.xml <?xml version="1.0" encoding="UTF-8"?><bea ...

  7. --mysql 导出数据时, 数字类型的列如果位数过长,变为科学计数法问题

    --mysql 导出数据时, 数字类型的列如果位数过长,变为科学计数法问题在字段前加上\t即可select concat('\t',a.IDCARD_NO) from xxx a

  8. 查出了a表,然后对a表进行自查询,a表的别名t1,t2如同两张表,因为t1,t2查询的条件不一样,真的如同两张表,关联两张表,可以将两行或者多行数据合并成一行,不必使用wm_concat()函数。为了将t2表的数据全部查出来使用了右连接。

    with a as( select nsr.zgswj_dm, count(distinct nsr.djxh) cnt, 1 z from hx_fp.fp_ly fp, hx_dj.dj_nsrx ...

  9. CentOS 7 休眠系统

    CentOS 7的电源按钮只有关机和重启两项,但是可以用命令来休眠系统: 重启: $ systemctl reboot 退出系统并停止电源: $ systemctl poweroff 待机: $ sy ...

  10. 初窥Java之三

    一.基本数据类型之浮点型 每个数据它自身都有一个默认的类型,如果直接打印小数,默认类型就为double类型: float和double表示小数的精度不是特别的高,如果对于精确度要求非常的高,我们 都使 ...