-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesigner.js
67 lines (57 loc) · 1.97 KB
/
designer.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
(function(ComboBox) {
"use strict";
ComboBox.setWidth('200');
ComboBox.setHeight('25');
ComboBox.addLabel();
ComboBox.customizeProperty('synchronized', {
title: 'Synchronized',
description: 'Synchronized with Choices'
});
//ComboBox.customizeProperty('allowEmpty', {
// title: 'Add Empty Entry'
//});
ComboBox.customizeProperty('autoComplete', {
title: 'Auto Complete'
});
ComboBox.customizeProperty('searchCriteria', {
title: 'Search Criteria'
});
ComboBox.doAfter('init', function() {
// synchrinized
this.synchronized.onChange(function() {
if(this.synchronized()) {
this.value.hide();
this.value.old = this.value();
this.value(null);
} else {
this.value.show();
this.value(this.value.old);
}
}.bind(this));
// autocomplete
this.autoComplete.onChange(function() {
if(this.autoComplete()) {
this.searchCriteria.show();
this.searchCriteria(this.searchCriteria.old);
} else {
this.searchCriteria.hide();
this.searchCriteria.old = this.searchCriteria();
this.searchCriteria(null);
}
}.bind(this));
// hide custom widgets parts configuration
_hideAttributesForm.call(this);
function _hideAttributesForm() {
var input = this.getPart('input');
var button = this.getPart('button');
// hide TextInput configuration
['value', 'inputType', 'maxLength', 'placeholder', 'readOnly'].forEach(function(attribute) {
input[attribute].hide();
});
// hide Button configuration
['plainText', 'title', 'url', 'actionSource'].forEach(function(attribute) {
button[attribute].hide();
});
}
});
});