The local hiddenfield used by Form in Extjs4

  • 2020-03-30 00:00:05
  • OfStack

 
Ext.onReady(function(){ 
Ext.QuickTips.init(); 
Ext.create("Ext.form.Panel",{ 
title:' local hiddenfield The instance ', 
renderTo:'formDemo', 
bodyPadding:'5 5 5 5', 
height:100, 
width:270, 
frame:true, 
defaults:{ 
labelSeparator :": ", 
labelWidth : 70, 
width : 200, 
allowBlank: false, 
msgTarget : 'side', 
labelAlign:'left' 
}, 
items:[{ 
xtype:'textfield', 
name:'name', 
fieldLabel:'name', 
value:'USPCAT.COM' 
},{ 
xtype:'hiddenfield', 
name:'age', 
value:'1' 
}], 
buttons:[{ 
text:' submit ', 
handler:function(){ 
this.up("form").getForm().submit({//This refers to the current component (button),up is found in the previous component (form).
params:{ 
info:'age It's a hidden field ' 
} 
}); 
} 
}] 
}); 
}) 

Related articles: