-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilterwindow.html
104 lines (84 loc) · 3.56 KB
/
filterwindow.html
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html>
<head>
<style>
select{
width:75%
}
</style>
<script type="text/javascript">
const electron=require('electron');
const ipc=electron.ipcRenderer;
var string,i,j,rowvalue,columnvalue;
var arrayResponsibility=['NCRScotland.ActiveXFS','NCR.APTRA','Activate.NCR.ChnApp','NCR.Dundee.DC','Activate.NAMER.ChnApp'];
var arrayOwner=['BusOpSupportTasksNDC','BusOpSupportTasksAIT','SDMSP','BusOpSupportTasksNDC','GBRUSP','BusOpSupportTasksNAMER'];
var arraySupply=['Always On','Warning','Error','Exception']
console.log(arrayResponsibility[1]);
function applycolumnfilter(){
var columns=document.forms[0];
string=" ";
for (i = 0; i < columns.length; i++) {
if (columns[i].checked) {
document.getElementById("description").value=columns[i].value;
columnvalue=columns[i].value;
if(columnvalue=='Responsibility'){
string=" ";
for(j=0;j<arrayResponsibility.length;j++){
string+="<option value="+arrayResponsibility[j]+">"+arrayResponsibility[j]+"</option>";
}
break;
}else if(columnvalue=='Owner'){
string=" ";
for(j=0;j<arrayOwner.length;j++){
string+="<option value="+arrayOwner[j]+">"+arrayOwner[j]+"</option>";
}
break;
}else if(columnvalue=='SupplyPoint'){
string=" ";
for(j=0;j<arraySupply.length;j++){
string+="<option value="+arraySupply[j]+">"+arraySupply[j]+"</option>";
}
break;
}
}
}
document.getElementById("options").innerHTML+=string;
}
function filterbyrow(val){
rowvalue=val;
}
function func(){
applyfilter(rowvalue,columnvalue);
}
function applyfilter(rowvalue,columnvalue){
ipc.send("filterattributes",rowvalue,columnvalue);
//console.log(jsonobj);
document.getElementById("prop").innerHTML="Hello";
}
</script>
</head>
<body>
<form onsubmit="return false">
<table>
<!-- <tr><td></td><td><input type=radio name="logical" value="and"><label for="and">and</label>
<input type=radio name="logical" value="or"><label for="or">or</label></td></tr> -->
<tr> <td>Datasource:</td><td> <select id='datasource'>
<option value="GENTRACE">GENTRACE</option>
<option value="GENTRACE2">GENTRACE2</option>
<option value="GENTRACE3">GENTRACE3</option>
</select></td></tr>
<tr><td style="vertical-align:0px;"> Elements:</td><td><input type="radio" name="columns" value="Responsibility"><label for="Responsibility">Responsibility</label>
<br><input type="radio" name="columns" value="Owner"><label for="Owner">Owner</label>
<br><input type="radio" name="columns" value="SupplyPoint"><label for="SupplyPoint">SupplyPoint</label>
<br><input type="radio" name="columns" value="FunctionName"><label for="FunctionName">FunctionName</label>
<br><button onclick="applycolumnfilter()">Apply</button></td></tr>
<tr><td>Description:</td><td><input type=text id="description" placeholder="select using radio options" size="75"></td></tr>
<tr><td></td><td><select required id='options' onchange='filterbyrow(this.value)' ><option>choose a value</option></select></td></tr>
</table>
<br> <input type="submit" onclick="func()" id="submit" value="Submit">
</form>
<script>
// require('./renderer.js')
</script>
</body>
</html>