Ext TextField의 Label 및 숨겨진 구성 요소

2341 단어 ext
Ext.onReady(function(){
		var TextVisable = new Ext.form.TextField({
				    fieldLabel: ' ',
		            labelWidth:100,
		            name: ' ',
		            value :'abc'
				});
		function hideText_1()
		{
			//1
			 TextVisable.el.parent().parent().hide();
			//2 TextVisable.el.dom.parentNode.parentNode.style.display = 'none';
		}
		function hideText_2()
		{
			//1 TextVisable.el.parent().parent().first().dom.innerHTML = ' '
			//2
			TextVisable.el.dom.parentNode.parentNode.firstChild.innerHTML= '  :'
		}
		/***************** *******************************/
		var date_1 = new  Ext.form.DateField({
				 fieldLabel: ' ',
				 labelWidth:100,
				 width:140,
				 name: ' '		
		});
		function hideText_3()
		{
			//1
			 date_1.el.parent().parent().parent().hide();
			//2 TextVisable.el.dom.parentNode.parentNode.parentNode.style.display = 'none';
		}
		function hideText_4()
		{
			//1 TextVisable.el.parent().parent().parent().first().dom.innerHTML = '  :'
			//2
			date_1.el.dom.parentNode.parentNode.parentNode.firstChild.innerHTML= '  :'
		}
		/***************** *******************************/
		var form = new Ext.form.FormPanel({
				        labelAlign: 'right',
				        title: 'form',
				        frame:true,
				        width: 300,
				        labelSeparator : ':',
				        items: [TextVisable,date_1],
				        tbar :['-',new Ext.Button({
								    text: " DateField",
									handler: hideText_3
							    }),'-',new Ext.Button({
								    text: " DateField label",
									handler: hideText_4
							    }),'-'],
				        buttons: [new Ext.Button({
								    text: " TextField",
									handler: hideText_1
							    }),new Ext.Button({
								    text: " TextField label",
									handler: hideText_2
							    })]
				    });
		form.render(document.body);
	});

좋은 웹페이지 즐겨찾기