-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDialog.js
More file actions
69 lines (55 loc) · 2.21 KB
/
Copy pathDialog.js
File metadata and controls
69 lines (55 loc) · 2.21 KB
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
68
69
Ext.define('EvolveQueryEditor.Dialog', {
extend: 'Infor.widget.DialogPluginBase',
requires: [
'EvolveQueryEditor.view.EditorControl',
'EvolveQueryEditor.util.QAALogger',
'EvolveQueryEditor.model.Query'
],
id: 'qnaDialogQueryEditor',
editorControl: undefined,
wrapper: undefined,
getContent: function () {
if (!this.wrapper) {
this.wrapper = Ext.create('Ext.panel.Panel');
}
return this.wrapper;
},
init: function (config, dialogData) {
var me = this,
proxyUrl = this.dialogContainer.getActionUrl('EvolveProxy', 'Index', { aliasName: me.dialogConfig.aliasName }),
loginUrl = this.dialogContainer.getActionUrl('EvolveProxy', 'Login', { aliasName: me.dialogConfig.aliasName, connectionInfo: me.dialogConfig.connectionInfo });
if (EvolveQueryEditor.model.Query.clientToken == undefined) {
Ext.Ajax.request({
url: loginUrl,
timeout: 60000,
async: true,
success: function (result, options) {
var res = Ext.decode(result.responseText);
var model = EvolveQueryEditor.model.Query;
model.clientToken = res.data.ClientToken;
model.serverUrlBase = proxyUrl;
me.editorControl = Ext.create('EvolveQueryEditor.view.EditorControl', {
dialogContainer: me.dialogContainer,
dialogConfig: me.dialogConfig
});
me.wrapper.add(me.editorControl);
},
failure: function (result, options) {
EvolveQueryEditor.util.QAAMsg.showErrorDialog(result.statusText);
}
});
}
},
buttonClicked: function (clickedButtonKey) {
var query;
var self = this;
if (clickedButtonKey === "Ok") {
query = this.editorControl.getQueryDefinition();
if(Ext.isEmpty(query)) {
return;
}
}
self.dialogContainer.close(query);
EvolveQueryEditor.model.Query.clientToken = undefined;
}
});