rails_db_admin 3.0.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{public → app/assets}/images/icons/rails_db_admin/rails_db_admin_16x16.png +0 -0
- data/{public → app/assets}/images/icons/rails_db_admin/rails_db_admin_24x24.png +0 -0
- data/{public → app/assets}/images/icons/rails_db_admin/rails_db_admin_32x32.png +0 -0
- data/{public → app/assets}/images/icons/rails_db_admin/rails_db_admin_64x64.png +0 -0
- data/{public → app/assets}/images/icons/rails_db_admin/rails_db_admin_light_16x16.png +0 -0
- data/app/assets/images/splash/db_admin_splash.png +0 -0
- data/{public → app/assets}/images/splash/images/console-icon.png +0 -0
- data/{public → app/assets}/images/splash/images/data-model-icon.png +0 -0
- data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/app.js +20 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/rails_db_admin/database_combo.js +1 -1
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/rails_db_admin/module.js +227 -135
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/rails_db_admin/queries_tree_menu.js +6 -6
- data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/query_panel.js +383 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/rails_db_admin/readonly_table_data_grid.js +0 -0
- data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/reports/ParamWindow.js +426 -0
- data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/reports/ParamsManager.js +177 -0
- data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/reports/RolesPanel.js +95 -0
- data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/reports/SetDefaultWindow.js +244 -0
- data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/reports/Settings.js +155 -0
- data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/reports/TreePanel.js +391 -0
- data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/splash_screen.js +163 -0
- data/{public → app/assets}/javascripts/erp_app/desktop/applications/rails_db_admin/tables_tree_menu.js +5 -3
- data/app/assets/javascripts/erp_app/shared/MultiOption.js +151 -0
- data/app/assets/javascripts/erp_app/shared/ReportsParams.js +289 -0
- data/app/assets/javascripts/erp_app/shared/rails_db_admin_shared.js +13 -0
- data/{public/stylesheets/erp_app/desktop/applications/rails_db_admin/rails_db_admin.css → app/assets/stylesheets/erp_app/shared/rails_db_admin_shared.css} +5 -10
- data/app/controllers/rails_db_admin/erp_app/desktop/base_controller.rb +7 -6
- data/app/controllers/rails_db_admin/erp_app/desktop/queries_controller.rb +88 -74
- data/app/controllers/rails_db_admin/erp_app/desktop/reports_controller.rb +361 -30
- data/app/controllers/rails_db_admin/reports/base_controller.rb +105 -22
- data/app/mailers/report_mailer.rb +15 -0
- data/app/models/report.rb +227 -14
- data/app/views/rails_db_admin/reports/base/error_report.erb +27 -0
- data/app/views/report_mailer/email_report.html.erb +255 -0
- data/config/routes.rb +2 -1
- data/db/data_migrations/20110816005525_rails_db_admin_application.rb +6 -14
- data/db/data_migrations/20151015093724_add_report_role_type.rb +15 -0
- data/db/migrate/20121210160131_add_reports.rb +2 -0
- data/db/migrate/20150926061259_add_meta_data_to_reports.rb +9 -0
- data/lib/rails_db_admin.rb +4 -2
- data/lib/rails_db_admin/engine.rb +12 -4
- data/lib/rails_db_admin/erp_string_parser.rb +26 -0
- data/lib/rails_db_admin/extensions/railties/action_view/helpers/report_helper.rb +167 -10
- data/lib/rails_db_admin/extjs/json_data_builder.rb +36 -20
- data/lib/rails_db_admin/query_params.rb +14 -0
- data/lib/rails_db_admin/query_support.rb +56 -46
- data/lib/rails_db_admin/services/report_helper.rb +241 -0
- data/lib/rails_db_admin/version.rb +1 -1
- metadata +41 -30
- data/app/assets/javascripts/rails_db_admin/application.js +0 -9
- data/app/assets/stylesheets/rails_db_admin/application.css +0 -7
- data/app/views/rails_db_admin/reports/base/show_report.erb +0 -11
- data/db/migrate/20131112013053_add_rails_db_admin_missing_indexes.rb +0 -17
- data/lib/rails_db_admin/report_support.rb +0 -52
- data/public/images/splash/splash.png +0 -0
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/query_panel.js +0 -223
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/report_panel.js +0 -78
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/reports_tree_panel.js +0 -237
- data/public/javascripts/erp_app/desktop/applications/rails_db_admin/splash_screen.js +0 -136
data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/reports/ParamsManager.js
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.RailsDbAdmin.Reports.ParamsManager", {
|
2
|
+
extend: "Ext.panel.Panel",
|
3
|
+
alias: 'widget.railsdbadminreportsparamsmanager',
|
4
|
+
report: null,
|
5
|
+
title: 'Report Params',
|
6
|
+
autoScroll: true,
|
7
|
+
currentRecord: null,
|
8
|
+
|
9
|
+
initComponent: function() {
|
10
|
+
var me = this;
|
11
|
+
me.dockedItems = [{
|
12
|
+
xtype: 'toolbar',
|
13
|
+
dock: 'top',
|
14
|
+
items: [{
|
15
|
+
xtype: 'button',
|
16
|
+
text: 'Add',
|
17
|
+
iconCls: 'icon-add',
|
18
|
+
handler: function() {
|
19
|
+
Ext.widget('railsdbadminreportsparamwindow', {
|
20
|
+
paramsManager: me,
|
21
|
+
isAdd: true
|
22
|
+
}).show();
|
23
|
+
}
|
24
|
+
}]
|
25
|
+
}];
|
26
|
+
|
27
|
+
me.callParent();
|
28
|
+
},
|
29
|
+
|
30
|
+
setReportData: function(report) {
|
31
|
+
var me = this;
|
32
|
+
|
33
|
+
me.clearReport();
|
34
|
+
|
35
|
+
me.report = report;
|
36
|
+
|
37
|
+
me.add(me.buildReportData());
|
38
|
+
},
|
39
|
+
|
40
|
+
buildReportData: function() {
|
41
|
+
var me = this;
|
42
|
+
return Ext.create('Ext.grid.Panel', {
|
43
|
+
viewConfig: {
|
44
|
+
plugins: {
|
45
|
+
ptype: 'gridviewdragdrop',
|
46
|
+
dragGroup: 'optionsGrid',
|
47
|
+
dropGroup: 'optionsGrid'
|
48
|
+
},
|
49
|
+
listeners: {
|
50
|
+
drop: function() {
|
51
|
+
me.save();
|
52
|
+
}
|
53
|
+
}
|
54
|
+
},
|
55
|
+
columns: [{
|
56
|
+
header: 'Display Name',
|
57
|
+
flex: 1,
|
58
|
+
dataIndex: 'display_name'
|
59
|
+
}, {
|
60
|
+
header: 'Name',
|
61
|
+
flex: 1,
|
62
|
+
dataIndex: 'name'
|
63
|
+
}, {
|
64
|
+
xtype: 'actioncolumn',
|
65
|
+
width: 75,
|
66
|
+
items: [{
|
67
|
+
icon: '/assets/icons/edit/edit_16x16.png',
|
68
|
+
tooltip: 'Edit',
|
69
|
+
handler: function(grid, rowIndex, colIndex) {
|
70
|
+
var record = grid.getStore().getAt(rowIndex);
|
71
|
+
Ext.widget('railsdbadminreportsparamwindow', {
|
72
|
+
paramsManager: me,
|
73
|
+
param: record
|
74
|
+
}).show();
|
75
|
+
}
|
76
|
+
}, {
|
77
|
+
icon: '/assets/icons/edit/edit_16x16.png',
|
78
|
+
tooltip: 'Set Default',
|
79
|
+
handler: function(grid, rowIndex, colIndex) {
|
80
|
+
var record = grid.getStore().getAt(rowIndex);
|
81
|
+
Ext.widget('railsdbadminreportssetdefaultwindow', {
|
82
|
+
paramsManager: me,
|
83
|
+
param: record
|
84
|
+
}).show();
|
85
|
+
}
|
86
|
+
}, {
|
87
|
+
icon: '/assets/icons/delete/delete_16x16.png',
|
88
|
+
tooltip: 'Delete',
|
89
|
+
handler: function(grid, rowIndex, colIndex) {
|
90
|
+
var record = grid.getStore().getAt(rowIndex);
|
91
|
+
grid.getStore().remove(record);
|
92
|
+
|
93
|
+
me.save();
|
94
|
+
}
|
95
|
+
}]
|
96
|
+
}],
|
97
|
+
padding: '0 0 35 0',
|
98
|
+
selType: 'rowmodel',
|
99
|
+
store: {
|
100
|
+
fields: ['name', 'type', 'display_name', 'options', 'default_value', 'required'],
|
101
|
+
data: me.report.get('reportMetaData').params
|
102
|
+
}
|
103
|
+
});
|
104
|
+
},
|
105
|
+
|
106
|
+
clearReport: function() {
|
107
|
+
var me = this;
|
108
|
+
me.removeAll();
|
109
|
+
me.report = null;
|
110
|
+
},
|
111
|
+
|
112
|
+
save: function() {
|
113
|
+
var me = this,
|
114
|
+
grid = me.down('grid'),
|
115
|
+
store = grid.getStore();
|
116
|
+
|
117
|
+
var reportParams = Ext.Array.map(store.data.items, function(item) {
|
118
|
+
return {
|
119
|
+
display_name: item.get('display_name'),
|
120
|
+
name: item.get('name'),
|
121
|
+
type: item.get('type'),
|
122
|
+
options: item.get('options'),
|
123
|
+
required: item.get('required'),
|
124
|
+
default_value: item.get('default_value')
|
125
|
+
};
|
126
|
+
});
|
127
|
+
|
128
|
+
var metaData = me.report.get('reportMetaData');
|
129
|
+
metaData.params = reportParams;
|
130
|
+
me.report.set('reportMetaData', metaData);
|
131
|
+
me.report.commit(false);
|
132
|
+
|
133
|
+
var myMask = new Ext.LoadMask(me, {
|
134
|
+
msg: "Please wait..."
|
135
|
+
});
|
136
|
+
myMask.show();
|
137
|
+
|
138
|
+
// save report params
|
139
|
+
Ext.Ajax.request({
|
140
|
+
url: '/rails_db_admin/erp_app/desktop/reports/update',
|
141
|
+
method: 'POST',
|
142
|
+
params: {
|
143
|
+
id: me.report.get('reportId')
|
144
|
+
},
|
145
|
+
jsonData: {
|
146
|
+
report_params: reportParams
|
147
|
+
},
|
148
|
+
success: function(response) {
|
149
|
+
var responseObj = Ext.decode(response.responseText);
|
150
|
+
if (responseObj.success) {
|
151
|
+
myMask.hide();
|
152
|
+
var centerRegion = me.up('window').down('#centerRegion'),
|
153
|
+
queryPanel = centerRegion.down('#' + me.report.get('internalIdentifier') + '-query');
|
154
|
+
|
155
|
+
if (queryPanel) {
|
156
|
+
queryPanel.down('reportparamspanel').destroy();
|
157
|
+
queryPanel.insert(
|
158
|
+
0, {
|
159
|
+
xtype: 'reportparamspanel',
|
160
|
+
region: 'north',
|
161
|
+
params: reportParams,
|
162
|
+
slice: 3
|
163
|
+
}
|
164
|
+
);
|
165
|
+
}
|
166
|
+
} else {
|
167
|
+
myMask.hide();
|
168
|
+
Ext.msg.alert('Error', 'Error saving report params');
|
169
|
+
}
|
170
|
+
},
|
171
|
+
failure: function() {
|
172
|
+
myMask.hide();
|
173
|
+
Ext.msg.alert('Error', 'Error saving report params');
|
174
|
+
}
|
175
|
+
});
|
176
|
+
}
|
177
|
+
});
|
@@ -0,0 +1,95 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.RailsDbAdmin.Reports.RolesPanel", {
|
2
|
+
extend: "Ext.panel.Panel",
|
3
|
+
alias: 'widget.railsdbadminreportsrolespanel',
|
4
|
+
title: 'Security/Visibility',
|
5
|
+
reportId: null,
|
6
|
+
reportRoles: null,
|
7
|
+
tbar: [
|
8
|
+
{
|
9
|
+
xtype: 'button',
|
10
|
+
text: 'Save',
|
11
|
+
iconCls: 'icon-save',
|
12
|
+
handler: function(btn){
|
13
|
+
var panel = btn.up('railsdbadminreportsrolespanel'),
|
14
|
+
reportRoles = panel.down('typeselectiontree').getSelectedTypes(),
|
15
|
+
waitMsg = Ext.Msg.wait("Loading roles...");
|
16
|
+
|
17
|
+
Ext.Ajax.request({
|
18
|
+
url:'/rails_db_admin/erp_app/desktop/reports/update',
|
19
|
+
method: 'POST',
|
20
|
+
params: {
|
21
|
+
id: panel.reportId,
|
22
|
+
report_roles: reportRoles.join(',')
|
23
|
+
},
|
24
|
+
success: function(response){
|
25
|
+
waitMsg.close();
|
26
|
+
var responseObj = Ext.decode(response.responseText);
|
27
|
+
if(responseObj.success){
|
28
|
+
|
29
|
+
}else{
|
30
|
+
waitMsg.close();
|
31
|
+
Ext.msg.alert('Error', 'Erorr setting roles');
|
32
|
+
}
|
33
|
+
},
|
34
|
+
failure: function(){
|
35
|
+
waitMsg.close();
|
36
|
+
Ext.msg.alert('Error', 'Erorr setting roles');
|
37
|
+
}
|
38
|
+
});
|
39
|
+
}
|
40
|
+
}
|
41
|
+
],
|
42
|
+
|
43
|
+
|
44
|
+
initComponent: function(){
|
45
|
+
var me = this;
|
46
|
+
me.items =[];
|
47
|
+
|
48
|
+
me.callParent();
|
49
|
+
},
|
50
|
+
|
51
|
+
setReportRoles: function(report){
|
52
|
+
var me = this;
|
53
|
+
|
54
|
+
me.removeAll();
|
55
|
+
me.reportId = report.get('reportId');
|
56
|
+
me.add({
|
57
|
+
xtype: 'typeselectiontree',
|
58
|
+
title: 'Select Roles',
|
59
|
+
typesUrl: '/api/v1/role_types',
|
60
|
+
typesRoot: 'role_types',
|
61
|
+
canCreate: true,
|
62
|
+
cascadeSelectionDown: true,
|
63
|
+
availableTypes: [],
|
64
|
+
defaultParentType: 'report'
|
65
|
+
});
|
66
|
+
var roleTypesTree = me.down('typeselectiontree'),
|
67
|
+
availableRoleTypes = [],
|
68
|
+
waitMsg = Ext.Msg.wait("Loading roles...");
|
69
|
+
|
70
|
+
Ext.Ajax.request({
|
71
|
+
url: '/api/v1/role_types.tree',
|
72
|
+
method: 'GET',
|
73
|
+
params: {
|
74
|
+
parent: 'report'
|
75
|
+
},
|
76
|
+
success: function (response) {
|
77
|
+
waitMsg.close();
|
78
|
+
var responseObj = Ext.decode(response.responseText);
|
79
|
+
if (responseObj.success) {
|
80
|
+
availableRoleTypes = responseObj.role_types;
|
81
|
+
roleTypesTree.setAvailableTypes(availableRoleTypes);
|
82
|
+
roleTypesTree.setSelectedTypes(report.get('reportMetaData').roles || []);
|
83
|
+
|
84
|
+
}else{
|
85
|
+
waitMsg.close();
|
86
|
+
Ext.msg.alert('Error', 'Error loading roles');
|
87
|
+
}
|
88
|
+
},
|
89
|
+
failure: function(){
|
90
|
+
waitMsg.close();
|
91
|
+
Ext.msg.alert('Error', 'Error loading roles');
|
92
|
+
}
|
93
|
+
});
|
94
|
+
}
|
95
|
+
});
|
data/app/assets/javascripts/erp_app/desktop/applications/rails_db_admin/reports/SetDefaultWindow.js
ADDED
@@ -0,0 +1,244 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.RailsDbAdmin.Reports.SetDefaultWindow", {
|
2
|
+
extend: 'Ext.window.Window',
|
3
|
+
alias: 'widget.railsdbadminreportssetdefaultwindow',
|
4
|
+
title: 'Set Default',
|
5
|
+
modal: true,
|
6
|
+
height: 300,
|
7
|
+
width: 400,
|
8
|
+
buttonAlign: 'center',
|
9
|
+
|
10
|
+
paramsManager: null,
|
11
|
+
param: null,
|
12
|
+
|
13
|
+
buttons: [{
|
14
|
+
text: 'Save',
|
15
|
+
handler: function(btn) {
|
16
|
+
var me = btn.up('window');
|
17
|
+
|
18
|
+
var grid = me.paramsManager.down('grid');
|
19
|
+
var form = me.down('form');
|
20
|
+
|
21
|
+
if (form.isValid()) {
|
22
|
+
var values = form.getValues();
|
23
|
+
|
24
|
+
me.param.set('default_value', values.default_value);
|
25
|
+
me.param.commit(false);
|
26
|
+
|
27
|
+
me.paramsManager.save();
|
28
|
+
|
29
|
+
me.hide();
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}, {
|
33
|
+
text: 'Cancel',
|
34
|
+
handler: function(btn) {
|
35
|
+
var window = btn.up('window');
|
36
|
+
|
37
|
+
window.hide();
|
38
|
+
}
|
39
|
+
}],
|
40
|
+
|
41
|
+
initComponent: function() {
|
42
|
+
var me = this;
|
43
|
+
|
44
|
+
me.items = [{
|
45
|
+
xtype: 'form',
|
46
|
+
bodyPadding: 10,
|
47
|
+
layout: 'form',
|
48
|
+
items: []
|
49
|
+
}];
|
50
|
+
|
51
|
+
this.callParent(arguments);
|
52
|
+
|
53
|
+
me.setType(me.param.get('type'));
|
54
|
+
},
|
55
|
+
|
56
|
+
setType: function(type) {
|
57
|
+
var me = this;
|
58
|
+
var form = me.down('form');
|
59
|
+
|
60
|
+
switch (type) {
|
61
|
+
case 'text':
|
62
|
+
form.add(me.buildDefaultTextField());
|
63
|
+
break;
|
64
|
+
case 'date':
|
65
|
+
form.add(me.buildDefaultDateField());
|
66
|
+
break;
|
67
|
+
case 'time':
|
68
|
+
form.add(me.buildDefaultTimeField());
|
69
|
+
break;
|
70
|
+
case 'select':
|
71
|
+
form.add(me.buildDefaultSelectField());
|
72
|
+
break;
|
73
|
+
case 'data_record':
|
74
|
+
form.add(me.buildDefaultDataRecordField());
|
75
|
+
break;
|
76
|
+
case 'service':
|
77
|
+
form.add(me.buildDefaultServiceUrlField());
|
78
|
+
break;
|
79
|
+
}
|
80
|
+
},
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Builds default textfield.
|
84
|
+
*/
|
85
|
+
buildDefaultTextField: function() {
|
86
|
+
var me = this;
|
87
|
+
var defaultValue = null;
|
88
|
+
|
89
|
+
if (me.param) {
|
90
|
+
defaultValue = me.param.get('default_value');
|
91
|
+
}
|
92
|
+
|
93
|
+
return [{
|
94
|
+
xtype: 'textfield',
|
95
|
+
fieldLabel: 'Default Value',
|
96
|
+
name: 'default_value',
|
97
|
+
value: defaultValue
|
98
|
+
}];
|
99
|
+
},
|
100
|
+
|
101
|
+
buildDefaultDateField: function() {
|
102
|
+
var me = this;
|
103
|
+
var defaultValue = 'current_date';
|
104
|
+
var displayName = null;
|
105
|
+
|
106
|
+
if (me.param) {
|
107
|
+
defaultValue = me.param.get('default_value');
|
108
|
+
options = me.param.get('options');
|
109
|
+
}
|
110
|
+
|
111
|
+
if (options.onlyWeeks == 'on') {
|
112
|
+
displayName = 'Week';
|
113
|
+
|
114
|
+
} else if (options.onlyMonths == 'on') {
|
115
|
+
displayName = 'Month';
|
116
|
+
|
117
|
+
} else {
|
118
|
+
displayName = 'Day';
|
119
|
+
}
|
120
|
+
|
121
|
+
return [{
|
122
|
+
xtype: 'combo',
|
123
|
+
fieldLabel: 'Default Value',
|
124
|
+
name: 'default_value',
|
125
|
+
displayField: 'display',
|
126
|
+
valueField: 'value',
|
127
|
+
store: Ext.create('Ext.data.Store', {
|
128
|
+
fields: ['display', 'value'],
|
129
|
+
data: [{
|
130
|
+
display: 'Current ' + displayName,
|
131
|
+
value: 'current'
|
132
|
+
}, {
|
133
|
+
display: 'Previous ' + displayName,
|
134
|
+
value: 'previous'
|
135
|
+
}, {
|
136
|
+
display: 'Next ' + displayName,
|
137
|
+
value: 'next'
|
138
|
+
}]
|
139
|
+
}),
|
140
|
+
queryMode: 'local',
|
141
|
+
value: defaultValue
|
142
|
+
}];
|
143
|
+
},
|
144
|
+
|
145
|
+
buildDefaultTimeField: function() {
|
146
|
+
var me = this;
|
147
|
+
var defaultValue = '';
|
148
|
+
|
149
|
+
if (me.param) {
|
150
|
+
defaultValue = me.param.get('default_value');
|
151
|
+
}
|
152
|
+
|
153
|
+
return [{
|
154
|
+
xtype: 'timefield',
|
155
|
+
fieldLabel: 'Default Value',
|
156
|
+
name: 'default_value',
|
157
|
+
value: defaultValue
|
158
|
+
}];
|
159
|
+
},
|
160
|
+
|
161
|
+
buildDefaultSelectField: function() {
|
162
|
+
var me = this;
|
163
|
+
var defaultValue = null;
|
164
|
+
var options = {
|
165
|
+
values: []
|
166
|
+
};
|
167
|
+
|
168
|
+
if (me.param) {
|
169
|
+
defaultValue = me.param.get('default_value');
|
170
|
+
options = me.param.get('options');
|
171
|
+
}
|
172
|
+
|
173
|
+
return [{
|
174
|
+
xtype: 'combo',
|
175
|
+
fieldLabel: 'Default Value',
|
176
|
+
queryMode: 'local',
|
177
|
+
store: eval((options.values || '[]')),
|
178
|
+
name: 'default_value',
|
179
|
+
value: defaultValue
|
180
|
+
}];
|
181
|
+
},
|
182
|
+
|
183
|
+
buildDefaultDataRecordField: function() {
|
184
|
+
var me = this;
|
185
|
+
var defaultValue = null;
|
186
|
+
var options = {};
|
187
|
+
|
188
|
+
if (me.param) {
|
189
|
+
defaultValue = me.param.get('default_value');
|
190
|
+
options = me.param.get('options');
|
191
|
+
}
|
192
|
+
|
193
|
+
return [{
|
194
|
+
xtype: 'businessmoduledatarecordfield',
|
195
|
+
fieldLabel: 'Default Value',
|
196
|
+
extraParams: {
|
197
|
+
business_module_iid: options.businessModule
|
198
|
+
},
|
199
|
+
name: 'default_value',
|
200
|
+
value: defaultValue
|
201
|
+
}];
|
202
|
+
},
|
203
|
+
|
204
|
+
buildDefaultServiceUrlField: function() {
|
205
|
+
var me = this;
|
206
|
+
var defaultValue = null;
|
207
|
+
var options = {};
|
208
|
+
|
209
|
+
if (me.param) {
|
210
|
+
defaultValue = me.param.get('default_value');
|
211
|
+
options = me.param.get('options');
|
212
|
+
}
|
213
|
+
|
214
|
+
// make sure we have all the options we need
|
215
|
+
if (options.root && options.displayField && options.valueField) {
|
216
|
+
return [{
|
217
|
+
xtype: 'combo',
|
218
|
+
fieldLabel: 'Default Value',
|
219
|
+
name: 'default_value',
|
220
|
+
value: defaultValue,
|
221
|
+
displayField: options.displayField,
|
222
|
+
valueField: options.valueField,
|
223
|
+
queryMode: 'remote',
|
224
|
+
store: {
|
225
|
+
proxy: {
|
226
|
+
type: 'ajax',
|
227
|
+
url: options.url,
|
228
|
+
reader: {
|
229
|
+
type: 'json',
|
230
|
+
root: options.root
|
231
|
+
}
|
232
|
+
},
|
233
|
+
fields: [
|
234
|
+
options.displayField,
|
235
|
+
options.valueField
|
236
|
+
],
|
237
|
+
autoLoad: true
|
238
|
+
}
|
239
|
+
}];
|
240
|
+
} else {
|
241
|
+
return null;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
});
|