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

首页要在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. php函数xml转化数组

    /** * xml转数组 * @param $xml * @return array */ function xml_to_array( $xml ) { $reg = "/<(\\w ...

  2. CentOS6—HAProxy安装与配置

    概述 Haproxy下载地址:http://pkgs.fedoraproject.org/repo/pkgs/haproxy/ 关闭SElinux.配置防火墙 1.vi /etc/selinux/co ...

  3. reconnecting-websocket.js

    websocket是HTML5下一个不错的网络协议解决方案,有一个场景很多猿猿都会遇到,手机锁屏后大约60秒,IOS会自动断开websocket连接,连接丢失了,那我们的数据也就断了.websocke ...

  4. noip2017逛公园

    题解: 之前知道正解并没有写过.. #include <bits/stdc++.h> using namespace std; #define rint register int #def ...

  5. 3897: Power

    题解: 首先很贪心的选择 有最大的我们一定会用最大的 然后可以将序列分割.. 就变成了一道模拟题了.. 每个状态记录(h,t,h-have,t-need) 注意一下细节就可以了 代码: #includ ...

  6. silverlight5 OOB 直接p/invoke实现串口通信

    public class SerialWrapper : IDisposable     {         #region Enum         public enum StopBits     ...

  7. eclipse4.2版本下面安装ADT,安装已经完成了,但没有ADT的那个图标显示

    如果安装过程没错,直接在Eclipse ->window->customize Perpective->Command Groups Availability 勾选andorid 选 ...

  8. Flink--3种分区方式

    partitionByHash //TODO partitionByHash val data = new mutable.MutableList[(Int, Long, String)] data. ...

  9. Codeforces 965E Short Code 启发式合并 (看题解)

    Short Code 我的想法是建出字典树, 然后让后面节点最多的点优先向上移到不能移为止, 然后gg. 正确做法是对于当前的节点如果没有被占, 那么从它的子树中选出一个深度最大的点换到当前位置. 用 ...

  10. python + seleinum +phantomjs 设置headers和proxy代理

    python + seleinum +phantomjs 设置headers和proxy代理     最近因为工作需要使用selenium+phantomjs无头浏览器,其中遇到了一些坑,记录一下,尤 ...