Extjs 4.2 实现文本框组 支付宝支付密码输入效果
来源:互联网 发布:梦幻西游手游 for mac 编辑:程序博客网 时间:2024/05/21 18:31
1.如下图:
2.Extjs 使用numberfield进行实现:
function uxInputChange(numfield, newV) {var neiboNumfield = numfield.nextNode("numberfield");if (!newV && 0 !== newV && "." != newV) {neiboNumfield = null;neiboNumfield = numfield.previousNode("numberfield");}try {neiboNumfield.focus(true);} catch (e) {console.log(e);}}Ext.create("Ext.form.Panel", {width : 400,height : 50,border : false,layout : "column",name : "azimuthForm",defaultType : "numberfield",defaults : {width : 23,frame : true,hideLabel : true,margin : "0 2 0 0",hideTrigger : true,minValue : 0,maxValue : 9,maxLength : 1,enforceMaxLength : 1,allowDecimals : true,autoStripChars : true,enableKeyEvents : true,listeners : {keypress : function(numfield, e, eOpts) {if (e.getKey() == e.BACKSPACE) {console.log("backspace fire move label");uxInputChange(numfield, false);}if ((e.getKey() > e.ZERO - 1 && e.getKey() < e.ZERO + 10) || e.ZERO - 2 == e.getKey()) {if (-1 != numfield.name.indexOf("1")) {if (e.ZERO - 2 == e.getKey()) {return;}}console.log("input fire move label"); uxInputChange(numfield, true);}}}},items : [{xtype : "label",width : 110,flex : 0,text : "扇区天线方位角:",style : {textAlign : "right"}}, {name : "azimuth1",margin : "0 2 0 3",allowDecimals : false}, {name : "azimuth2"}, {name : "azimuth3"}, {name : "azimuth4"}, {name : "azimuth5"}, {name : "azimuth6",margin : "0"}],renderTo : Ext.getBody()});3.上面的uxInputChange是自定义的函数,主要功能是找到邻近的numberfield进行光标的定位,并选中该文本框的文字
4.本例中以数字+小数的方式实现光标的自动移动,并监听删除按钮,小数点按钮,使得小数点不在首位,并自动过滤非数字文本方便验证
5.示例代码效果如下:
1 0
- Extjs 4.2 实现文本框组 支付宝支付密码输入效果
- Android高效率实现自定义密码输入效果,仿微信和支付宝密码输入效果
- 封装仿支付宝密码输入效果
- 仿支付宝支付密码输入框
- Android 支付宝支付密码输入界面
- 仿微信支付宝输入支付密码
- 仿支付宝支付 密码输入
- 仿微信/支付宝的密码输入框效果 android
- 仿微信/支付宝的密码输入框效果 android
- 仿微信/支付宝的密码输入框效果 android
- 仿微信/支付宝的密码输入框效果:GridPasswordView
- Android 仿微信/支付宝的密码输入框效果(一)
- 简单仿支付宝/微信密码输入效果
- jQuery插件模拟支付宝密码输入框效果
- 实现简单输入支付密码的输入
- 带格子的密码输入框,类似微信,支付宝支付时候的输入密码页面效果
- 安卓实现支付宝6位密码输入界面
- 安卓实现支付宝6位密码输入界面
- 打印0~99的阶乘
- BPM那些事儿——BPM流程管理软件的五大创新
- HDU 1158 Employment Planning
- hdu 5402 Travelling Salesman Problem (构造)
- 【Android】pull解析xml文件+将数据存储为xml格式,并保存在内存里
- Extjs 4.2 实现文本框组 支付宝支付密码输入效果
- 交叉编译的configure
- HDU 4709 Herding
- Linux 静态IP地址设置
- 简单Core Animation
- 二分之查找
- jquery选中多个标签、选中多个class的标签
- 通用权限管理设计篇
- codeforces 569A__Music