comparison app/view/widget/base/FieldSet.js @ 548:d47ee7439f44

Added new js files.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 06 Mar 2015 12:43:52 +0100
parents
children fead63bb5fb4
comparison
equal deleted inserted replaced
547:f172b35a3b92 548:d47ee7439f44
1 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU GPL (v>=3)
5 * and comes with ABSOLUTELY NO WARRANTY! Check out
6 * the documentation coming with IMIS-Labordaten-Application for details.
7 */
8
9 Ext.define('Lada.view.widget.base.FieldSet', {
10 extend: 'Ext.form.FieldSet',
11 alias: 'widget.fset',
12
13 plainTitle: '',
14 origColor: '',
15
16 showWarningOrError: function(warning, warningText, error, errorText) {
17 var ndx = 0;
18 if (this.collapsible === true) {
19 ndx = 1;
20 }
21 this.plainTitle = this.getEl().dom.firstChild
22 .firstChild.firstChild
23 .children[ndx].innerHTML;
24 this.origColor = this.getEl().dom.style['border-color'];
25 if (error) {
26 this.getEl().dom.style['border-color'] = '#FF0000';
27 this.getEl().dom.firstChild.firstChild.firstChild
28 .children[ndx].innerHTML =
29 '<img src="resources/img/icon-error.gif" width="12" height="12" /> ' +
30 this.plainTitle;
31 if (errorText) {
32 Ext.create('Ext.tip.ToolTip', {
33 target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx],
34 html: errorText
35 });
36 }
37 return;
38 }
39 if (warning) {
40 this.getEl().dom.style['border-color'] = '#FFE25D';
41 this.getEl().dom.firstChild.firstChild.firstChild
42 .children[ndx].innerHTML =
43 '<img src="resources/img/icon-warning.gif" width="12" height="12" /> ' +
44 this.plainTitle;
45 if (warningText) {
46 Ext.create('Ext.tip.ToolTip', {
47 target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx],
48 html: warningText
49 });
50 }
51 return;
52 }
53 },
54
55 clearMessages: function() {
56 var ndx = 0;
57 if (this.collapsible === true) {
58 ndx = 1;
59 }
60 if (this.plainTitle !== '') {
61 this.getEl().dom.firstChild
62 .firstChild.firstChild
63 .children[ndx].innerHTML = this.plainTitle;
64 this.getEl().dom.style['border-color'] = this.origColor;
65 }
66 }
67 });

http://lada.wald.intevation.org