Extjs 获取输入框焦点,并选中值

, {
				xtype : 'numberfield',
				name : 'CONSTRUCTION_QUANTITY_',
				fieldLabel : '<spring:message code="ITEM_PROJECT.CONSTRUCTION_QUANTITY_" />',
				decimalPrecision : 4,
				value : 1,
				allowBlank : false,
				listeners : {
					'focus' : function(f) {
						this.focus(true, 100);//eg:focus(true, 1000),true是否选中输入框的值,第二个参数 延迟时间 毫秒1000,
					}
				}
			}

 然后设置鼠标焦点默认位置:

var form = Ext.getCmp('formPanel').getForm();
form.findField('CONSTRUCTION_QUANTITY_').focus();

 

猜你喜欢

转载自www.cnblogs.com/mwd-banbo/p/10005867.html
今日推荐