说明:该组件代替了传统的text组件。

属性:

--fieldLabel:文本框的标签名称

方法:

--getValue():得到当前文本框的值

 

Ext.layout.FormLayout:只有在些布局下才能正确显示文本框的标签名,布局的宿主对象必须是

Ext.Container或者Ext.Container的子类。

在应用FormLayout布局时只要在宿主对象的构造参数中指定layout:”form”即可。

Ext.getCmp(String _id):得到id为_id的组件对象。

 

示例:

Ext.onReady(function(){
	var _panel = new Ext.Panel({
		renderTo:Ext.getBody(),
		layout:"form",
		labelWidth:50,
		listeners:{
			"render":function(_panel){
				_panel.add(new Ext.form.TextField({
					id:"txt_name",
					fieldLabel:"姓名"
				}));
			}
		}
	});
});

相关文章:

  • 2022-02-16
  • 2021-07-06
  • 2021-09-19
  • 2021-08-28
  • 2022-01-09
  • 2021-07-13
  • 2021-09-03
  • 2021-07-11
猜你喜欢
  • 2022-02-06
  • 2021-11-24
  • 2021-11-07
  • 2022-12-23
  • 2022-01-24
  • 2021-08-06
  • 2022-12-23
相关资源
相似解决方案