comparison app/view/widget/base/FieldSet.js @ 717:f124d24c8ade

Datevalidation. When editing a timeperiod in a Probeform it is validated wheter begindate is before enddate. This only happens when the blur-event is fired. ToDo: Listen to Events from the Übernehmen Button of the DateTimePicker, ToDo: Somehow the ErrorMessages are not Cleared correctly when the form is restored.
author Dustin Demuth <dustin@intevation.de>
date Mon, 13 Apr 2015 16:22:34 +0200
parents 1e1534482bfd
children c2a6f7caa71b
comparison
equal deleted inserted replaced
716:b400629a2575 717:f124d24c8ade
12 12
13 plainTitle: '', 13 plainTitle: '',
14 origColor: '', 14 origColor: '',
15 errorText: '', 15 errorText: '',
16 warningText: '', 16 warningText: '',
17 tooltip: null,
17 18
18 showWarningOrError: function(warning, warningText, error, errorText) { 19 showWarningOrError: function(warning, warningText, error, errorText) {
20 this.clearMessages(); //Clear Errors and Warning first
19 var ndx = 0; 21 var ndx = 0;
20 if (this.collapsible === true) { 22 if (this.collapsible === true) {
21 ndx = 1; 23 ndx = 1;
22 } 24 }
23 if (this.errorText && this.errorText !== '') { 25 if (this.errorText && this.errorText !== '') {
37 this.getEl().dom.firstChild.firstChild.firstChild 39 this.getEl().dom.firstChild.firstChild.firstChild
38 .children[ndx].innerHTML = 40 .children[ndx].innerHTML =
39 '<img src="resources/img/emblem-important.png" width="13" height="13" /> ' + 41 '<img src="resources/img/emblem-important.png" width="13" height="13" /> ' +
40 this.plainTitle; 42 this.plainTitle;
41 if (errorText) { 43 if (errorText) {
42 Ext.create('Ext.tip.ToolTip', { 44 if (!this.tooltip) {
43 target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx], 45 Ext.create('Ext.tip.ToolTip', {
44 html: errorText 46 target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx],
45 }); 47 html: errorText
48 });
49 }
50 else {
51 tooltip.html = errorText;
52 }
46 } 53 }
47 return; 54 return;
48 } 55 }
49 if (warning) { 56 if (warning) {
50 this.getEl().dom.style['border-color'] = '#FFE25D'; 57 this.getEl().dom.style['border-color'] = '#FFE25D';
51 this.getEl().dom.firstChild.firstChild.firstChild 58 this.getEl().dom.firstChild.firstChild.firstChild
52 .children[ndx].innerHTML = 59 .children[ndx].innerHTML =
53 '<img src="resources/img/dialog-warning.png" width="13" height="13" /> ' + 60 '<img src="resources/img/dialog-warning.png" width="13" height="13" /> ' +
54 this.plainTitle; 61 this.plainTitle;
55 if (warningText) { 62 if (warningText) {
56 Ext.create('Ext.tip.ToolTip', { 63 if (!this.tooltip) {
57 target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx], 64 Ext.create('Ext.tip.ToolTip', {
58 html: warningText 65 target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx],
59 }); 66 html: warningText
67 });
68 }
69 else {
70 tooltip.html = warningText;
71 }
60 } 72 }
61 return; 73 return;
62 } 74 }
63 }, 75 },
64 76

http://lada.wald.intevation.org