Define a component to add to the Formpanel
var dqszj = {
Fieldlabel: ' Current level ',
xtype: ' Combo ',
hiddenname: ' Dqszj ',
readonly:true,
TriggerAction: ' All ',
Displayfield: "Dmmc",
emptytext: ' Must fill ',
allowblank:false,
valuefield: ' DMJC ',
store:new Ext.data.JsonStore ({
url:contextpath+ '/system/jcsdaction.do?method=getqtdm&dmlb=nj '),
autoload:true,
fields:["DMJC", "Dmmc"
})
};
var form = new Ext.formpanel ({
id: ' AddForm ',
layout: ' form ',
titile: ' form ',
Border:false,
Bodystyle: ' padding:5px ',
defaults:{
xtype: ' fieldset ',
Margins: ' 4 4 4 4 ',
labelwidth:90,
Collapsible:true
}
Modify properties here
if (FORMDATA.SFBT = = "true") {
Textfield.allowblank = true;
Textfield.emptytext = ';
Textfield.reset ();
Textfield.hide ();
Textfield.show ();
The effect is as follows:
Many methods have been tried in the beginning, none of them can achieve the result.
Textfield.clearinvalid ();
Textfield.setemptytext ("");
Textfield.render ();
EXT.GETCMP (' AddForm '). Render ();
EXT.GETCMP (' AddForm '). Remove (DQSZJ);
EXT.GETCMP (' AddForm '). Add (DQSZJ);
EXT.GETCMP (' AddForm '). Dolayout ();
Form.getform (). FindField (XM). Getel (). Dom.readonly = true;