如何修改TextField的Label和EmptyText
在需求中常常有修改form表单的标签和空文本提示,在渲染后组件有些字符固定下来
除非使用document进行原始修改,通过查询stackflow,我介绍更方便方法
模拟场景:点击ChangeLabel后TextField和emptyText都要修改


相关代码:
function buildField(){
var field = new Ext.form.TextField({
id:'field',
fieldLabel:'TextField',
emptyText:'emptyText',
width:300
});
var btn = new Ext.Button({
id : 'btn',
text : 'changeLabel',
handler:function(){
var f = Ext.getCmp('field');
//通过方位Properties属性得到label对象,使用update方法可以更新innerHMTL
f.label.update('I had change:');
//修改emptyText是通过查看源代码得到的,reset方法会调用applyEmptyText方法重置emptytext
f.emptyText = "emptyChange";
f.reset();
}
})
var form = new Ext.form.FormPanel({
id:'FormPlane',
renderTo:Ext.getBody(),
border:false,
frame:false,
style:'margin-top:5px',
labelAlign:'right',
items:[field,btn]
});
}
Ext.onReady(buildField);
如何修改TextField的Label和EmptyText的更多相关文章
- Flutter 修改TextField的高度,以及无边框圆角
修改TextField的高度可以通过decoration: InputDecoration的contentPadding进行修改,代码如下 new TextField( decoration: Inp ...
- Flutter:修改TextField的高度,以及无边框圆角
修改TextField的高度可以通过decoration: InputDecoration的contentPadding进行修改,代码如下 new TextField( decoration: Inp ...
- 以下内容对于灵活修改textField中文本以及占位文本属性进行了完整的封装,加入项目中可以节约开发时间。
textField对占位文本设置属性有限,在项目中需要改变占位文本的属性以及位置,需要自己对控件进行封装 封装方法如下: 在LDTextField.m 文件中: #import <UIKit/U ...
- iOS修改TextField占位符颜色大小
UITextField *addCtrolField = [[UITextField alloc]initWithFrame:CGRectMake(CGRectGetMaxX(rightTitleLa ...
- ios修改textField的placeholder的字体颜色和大小
textField.placeholder = @"username is in here!"; [textField setValue:[UIColor redColor] fo ...
- 修改textField的placeholder的字体颜色、大小
textField.placeholder = @"username is in here!"; [textField setValue:[UIColor redColor] fo ...
- 修改textField的placeholder的字体和颜色
textField.placeholder = @"username is in here!"; [textField setValue:[UIColor redColor] fo ...
- ios修改textField的placeholder的字体颜色、大小
textField.placeholder = @"username is in here!"; [textField setValue:[UIColor redColor] fo ...
- 修改textfield的占位符颜色
[self.titleField setValue:UIColorFromHEXWithAlpha(0x999999, 1) forKeyPath:@"_placeholderLabel.t ...
随机推荐
- Spring ApplicationContext的事件机制
ApplicationContext的事件机制是观察者设计模式的实现,通过 ApplicationEvent 类和 ApplicationListener 接口,可以实现 ApplicationCon ...
- 转:你需要知道的NoSQL数据库10件事
你需要知道的NoSQL数据库10件事 NoSQL的5个优势 1.弹性扩展 多年来,数据库管理员一直依赖于向上扩展(scale up)-随着数据库负载的增加购买更大的数据库服务器―而不是向外扩展-随着负 ...
- Node.js 入门(2)
1.http 请求 //调用Node.js自带的http模块 var http = require("http"); //调用http模块提供的函数createServer htt ...
- QT 设置SizePolicy的例子(简单明了)
http://hi.baidu.com/cybertingred/item/e8eadaad0c7f62f615329be7 QPushButton *left = new QPushButton ...
- 王学长的LCT标程
善良的王学长竟然亲自打了一遍QAQ好感动QAQ #include<iostream> #include<cstdio> #include<cmath> #inclu ...
- 【二分】【高精度】Vijos P1472 教主的集合序列
题目链接: https://vijos.org/p/1472 题目大意: S1={1,2,3…n}.当i>1时,Si为集合Si-1中任意两个不相同数之和的集合. 将每个集合中所有元素取出,集合S ...
- 金洪林:红邦创衣止于至善_品牌-生活时尚_品牌_YOKA时尚网
金洪林:红邦创衣止于至善_品牌-生活时尚_品牌_YOKA时尚网 金洪林:红邦创衣止于至善
- Drainage Ditches - poj 1273(网络流模板)
题意:1是源点,m是汇点,求出来最大流量,没什么好说的就是练习最大流的模板题 ************************************************************* ...
- 通过百度获取IP地址对应的经纬度
/** * 获取指定IP对应的经纬度(为空返回当前机器经纬度) * * @param ip * @return */ public static String[] getIPXY(String ip ...
- 修改CKFinder上传路径
一.CKFinder的若干问题 1.单独使用 ckfinder从原fckeditor分离出来以后可以单独使用,通常我习惯于在工具栏中添加ckfinder.dll,这样以后要使用ckfinder直接从工 ...