/
AtomFormField.js
41 lines (38 loc) · 1.27 KB
/
AtomFormField.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/// <reference path="../controls/AtomControl.js" />
(function (baseType) {
return classCreatorEx({
name: "WebAtoms.AtomFormField",
base: baseType,
start: function () {
this._presenters = ["contentPresenter"];
},
properties: {
label: undefined,
fieldId:undefined,
fieldClass: undefined,
required: false,
fieldVisible: true
},
methods: {
set_fieldVisible: function (v) {
this._fieldVisible = v;
$(this._element).css("display", v ? '' : 'none');
},
set_fieldClass: function (v) {
this._fieldClass = v;
this.setLocalValue('class', v, this._element);
},
onCreated: function () {
this.setup();
},
setup: function () {
if (!this._created)
return;
if (this._contentPresenter) {
this._contentPresenter.appendChild(this._element.contentElement);
}
AtomBinder.refreshValue(this, "fieldClass");
}
}
});
})(WebAtoms.AtomControl.prototype);