# HG changeset patch # User Raimund Renkert # Date 1464353472 -7200 # Node ID 5ceb0381ae73df45514a3f7976b83bf51b6cc016 # Parent 255d550e74f48e781258d86071678e8760480f50 Set a regex and required for ortszuordnungstyp field. diff -r 255d550e74f4 -r 5ceb0381ae73 app/controller/form/Ortszuordnung.js --- a/app/controller/form/Ortszuordnung.js Thu May 26 14:56:41 2016 +0200 +++ b/app/controller/form/Ortszuordnung.js Fri May 27 14:51:12 2016 +0200 @@ -152,7 +152,9 @@ */ dirtyForm: function(form, dirty) { if (dirty) { - form.owner.down('button[action=save]').setDisabled(false); + if (form.getValues().ortId !== '') { + form.owner.down('button[action=save]').setDisabled(false); + } form.owner.down('button[action=discard]').setDisabled(false); } else { diff -r 255d550e74f4 -r 5ceb0381ae73 app/view/form/Ortszuordnung.js --- a/app/view/form/Ortszuordnung.js Thu May 26 14:56:41 2016 +0200 +++ b/app/view/form/Ortszuordnung.js Fri May 27 14:51:12 2016 +0200 @@ -81,7 +81,9 @@ }, { xtype: 'tfield', labelWidth: 125, - maxLength: 100, + maxLength: 1, + allowBlank: false, + regex: /[U,E,Z,A]/, name: 'ortszuordnungTyp', fieldLabel: i18n.getMsg('ortszuordnung.form.field.ortszuordnungtyp') }, { diff -r 255d550e74f4 -r 5ceb0381ae73 app/view/widget/base/TextField.js --- a/app/view/widget/base/TextField.js Thu May 26 14:56:41 2016 +0200 +++ b/app/view/widget/base/TextField.js Fri May 27 14:51:12 2016 +0200 @@ -28,7 +28,7 @@ enforceMaxLength: this.enforceMaxLength || true, fieldLabel: this.fieldLabel, labelWidth: this.labelWidth, - readOnly: this.readOnly || false, + readOnly: this.readOnly || false, listeners: this.listeners }, { xtype: 'image', @@ -46,6 +46,12 @@ hidden: true }]; this.callParent(arguments); + if (this.regex) { + Ext.apply(this.down('textfield'), {regex: this.regex}); + } + if (this.allowBlank === false) { + Ext.apply(this.down('textfield'), {allowBlank: this.allowBlank}); + } }, showWarnings: function(warnings) {