必填:
win.down('form').getForm().findField('orderType').allowBlank=false;
添加红色*号
combo.up('form').getForm().findField('storeId').setFieldLabel('<span style="color: rgb(255, 0, 0); padding-left: 2px;">*</span>' + combo.up('form').getForm().findField('storeId').getFieldLabel());
取消必填时,红色*号需要单独隐藏
combo.up('form').getForm().findField('storeId').allowBlank=true;
combo.up('form').getForm().findField('storeId').setFieldLabel(combo.up('form').getForm().findField('storeId').initialConfig.fieldLabel);
注意如果是根据下拉判断是否必填时,添加*号时,需要先隐藏一下,否则会添加多个*号
combo.up('form').getForm().findField('storeId').allowBlank=false;
combo.up('form').getForm().findField('storeId').setFieldLabel(combo.up('form').getForm().findField('storeId').initialConfig.fieldLabel);
combo.up('form').getForm().findField('storeId').setFieldLabel('<span style="color: rgb(255, 0, 0); padding-left: 2px;">*</span>' + combo.up('form').getForm().findField('storeId').getFieldLabel());
隐藏:
win.down('form').getForm().findField('orderType').enable();
win.down('form').getForm().findField('orderType').show();
win.down('form').getForm().findField('orderType').disable();
win.down('form').getForm().findField('orderType').hide();
禁用:
win.down('form').getForm().findField('orderType').readOnly=false;
// 如readOnly改为true,可能文本框还是白色的问题,设置一下背景颜色
win.down('form').getForm().findField('accountBookNo').setFieldStyle('background-color: #E6E6E6;background-image: none;');