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

首页要在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. [转] node升级到8.0.0在vscode启动js执行文件报错

    由于升级node 到 8.0.0 版本 vscode 启动一直报错: `node --debug` and `node --debug-brk` are invalid. Please use `no ...

  2. 【bzoj4976】宝石镶嵌

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

  3. python函数默认参数为可变对象的理解

    1.代码在执行的过程中,遇到函数定义,初始化函数生成存储函数名,默认参数初识值,函数地址的函数对象. 2.代码执行不在初始化函数,而是直接执行函数体. 代码实例 这要从函数的特性说起,在 Python ...

  4. 2018牛客网暑假ACM多校训练赛(第二场)E tree 动态规划

    原文链接https://www.cnblogs.com/zhouzhendong/p/NowCoder-2018-Summer-Round2-E.html 题目传送门 - 2018牛客多校赛第二场 E ...

  5. windows安装Python虚拟环境

    1.pip install virtualenv 安装virtualenv镜像 3.virtualenv  scrapytest 新建virtualenv 4.cd到\scrapytest\Scrip ...

  6. linux中通过lsof恢复删除的文件,前题是fd被占用。

    http://www.serverwatch.com/tutorials/article.php/3822816/Recovering-Deleted-Files-With-lsof.htm One ...

  7. day29 网络编程

    网络通信原理: http://www.cnblogs.com/linhaifeng/articles/5937962.html 一.操作系统基础 二.网络通信原理 2.1 互联网的本质就是一系列的网络 ...

  8. html-列表-3

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. 在VS2017(VC15)上配置opencv4.0.1环境

    在VS2017(VC15)上配置opencv4.0.1环境   转 https://blog.csdn.net/GoldenBullet/article/details/86016921 作为萌新最初 ...

  10. CMake结合Visual Studio中开发Qt应用程序注意事项

    Qt工程管理 个人比较偏爱于使用CMake来管理C++工程,因为只要编写一个CMakeLists.txt文件,就可以在Windows和Mac上生成各自的IDE工程.在Windows上, CMake自然 ...