Marthee commited on
Commit
b29738d
·
verified ·
1 Parent(s): fd9e560

Update templates/proposed-GUI.html

Browse files
Files changed (1) hide show
  1. templates/proposed-GUI.html +15 -11
templates/proposed-GUI.html CHANGED
@@ -446,20 +446,22 @@ $(firstdropdown).on("change", function (e) {
446
  console.log(firstDpwnValue)
447
  displayprojparts(firstDpwnValue);
448
  })
449
-
450
  function displayprojparts(name){
451
  document.getElementById("all").style.display = "block";
452
  $.get('/getprojectparts/'+JSON.stringify(name))
453
  .success(function(data){
454
  document.getElementById("all").style.display = "none";
455
- partsArrwithID= data;
456
- for (let i=0;i<data.length;i++)
 
 
457
  {
458
  opt=document.createElement("option");
459
- opt.value=data[i];
460
- opt.text=data[i];
461
  seconddropdown.append(opt);
462
- PrjPartsArray.push(data[i]);
463
 
464
  }
465
 
@@ -480,6 +482,7 @@ $(seconddropdown).on("change", function (e) {
480
  })
481
 
482
  function displayprojsections(projectName,PartName){
 
483
  document.getElementById("all").style.display = "block";
484
  measSelect.innerHTML='';
485
  relvSelect.innerHTML='';
@@ -562,9 +565,10 @@ worker.onmessage= function(event){
562
 
563
  if (val=='firstonly')
564
  worker.postMessage(firstdropdown.value)
565
- else if (val=='firstSecond')
566
  {
567
- worker.postMessage([firstdropdown.value,seconddropdown.value])
 
568
  }
569
  var data=JSON.parse(event.data);
570
  console.log(data)
@@ -2780,8 +2784,8 @@ function confirmDialog() {
2780
  // function cancelDialog() {
2781
  // overlayme.style.display = "none";
2782
  // }
2783
- function refreshAPIbuutton(dataa){
2784
- $.get('/refreshAPIAppendNewTables')
2785
  .success(function(successData){
2786
 
2787
  if (dataa[1]==='project')
@@ -2874,7 +2878,7 @@ function callrefreshAPI(){
2874
  }
2875
  if ((firstdropdown.value) && (seconddropdown.value))
2876
  {
2877
- $.getJSON('/refreshAPI', {prjname: firstdropdown.value, prjpart: seconddropdown.value,},function(data11){
2878
  refreshAPIbuutton(data11)
2879
 
2880
  })
 
446
  console.log(firstDpwnValue)
447
  displayprojparts(firstDpwnValue);
448
  })
449
+ var partsArrIDsonly=[]
450
  function displayprojparts(name){
451
  document.getElementById("all").style.display = "block";
452
  $.get('/getprojectparts/'+JSON.stringify(name))
453
  .success(function(data){
454
  document.getElementById("all").style.display = "none";
455
+ partsArrwithID= data[0];
456
+ partsArrIDsonly= data[1];
457
+
458
+ for (let i=0;i<data[0].length;i++)
459
  {
460
  opt=document.createElement("option");
461
+ opt.value=data[0][i];
462
+ opt.text=data[0][i];
463
  seconddropdown.append(opt);
464
+ PrjPartsArray.push(data[0][i]);
465
 
466
  }
467
 
 
482
  })
483
 
484
  function displayprojsections(projectName,PartName){
485
+ console.log(seconddropdown.selectedIndex)
486
  document.getElementById("all").style.display = "block";
487
  measSelect.innerHTML='';
488
  relvSelect.innerHTML='';
 
565
 
566
  if (val=='firstonly')
567
  worker.postMessage(firstdropdown.value)
568
+ else if (val=='firstSecond')
569
  {
570
+
571
+ worker.postMessage([firstdropdown.value,seconddropdown.value,partsArrIDsonly[seconddropdown.selectedIndex-1]])
572
  }
573
  var data=JSON.parse(event.data);
574
  console.log(data)
 
2784
  // function cancelDialog() {
2785
  // overlayme.style.display = "none";
2786
  // }
2787
+ function refreshAPIbuutton(dataa){
2788
+ $.get('/refreshAPIAppendNewTables')
2789
  .success(function(successData){
2790
 
2791
  if (dataa[1]==='project')
 
2878
  }
2879
  if ((firstdropdown.value) && (seconddropdown.value))
2880
  {
2881
+ $.getJSON('/refreshAPI', {prjname: firstdropdown.value, prjpart: seconddropdown.value,prjpartid:partsArrIDsonly[seconddropdown.selectedIndex-1],},function(data11){
2882
  refreshAPIbuutton(data11)
2883
 
2884
  })