setDisabled보다 Form 수정 기능 차단
2122 단어 양식 수정 EXT JS
// form , setDisabled
setFormDisabled:function(readonly){
setTimeout(function(){
// this.formField.ownershipType.setDisabled(readonly);
// this.formField.externalInvest.setDisabled(readonly);
// this.formField.busiPlace.setDisabled(readonly);
for(var i in this.edeclareManagementForm.formField){
var objectItems = this.edeclareManagementForm.formField[i].items;
for(var j=0;objectItems&&j<objectItems.length;j++){
objectItems.itemAt(j).readOnly = readonly;
}
}
// this.setGridDisabled(this.edeclareManagementForm.investGrid,readonly);
// this.setGridDisabled(this.edeclareManagementForm.manageGrid,readonly);
// this.setGridDisabled(this.edeclareManagementForm.declarantGrid,readonly);
// this.edeclareManagementForm.investGrid.setDisabled(readonly);
// this.edeclareManagementForm.manageGrid.setDisabled(readonly);
// this.edeclareManagementForm.declarantGrid.setDisabled(readonly);
this.edeclareManagementForm.getForm().items.each(function(f){
if (typeof f.setDisabled=='function') {
if (readonly) {
// f.removeClass('x-form-field-readonly');
// f.addClass('x-form-field-readonly');
f.el.dom.readOnly = true;
//
if (f.onTriggerClick) {
f.disabled = true;
}
} else {
// f.removeClass('x-form-field-readonly');
f.el.dom.readOnly = false;
if (f.onTriggerClick) {
f.disabled = false;
}
}
}
f.initValue();
}.createDelegate(this));
if(readonly){
this.edeclareManagementForm.getForm().findField("registerDate").blur();
}else{
this.edeclareManagementForm.getForm().findField("registerDate").focus(false);
}
}.createDelegate(this), 150);
},