From 574024448adfbbf158721ed40ab7b787fd602341 Mon Sep 17 00:00:00 2001 From: TatianaBurek Date: Thu, 9 May 2019 08:53:21 -0600 Subject: [PATCH] fixed databases reloading --- webapp/metviewer/js/metviewer_common.js | 7 ++++++- webapp/metviewer/js/metviewer_common.min.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/webapp/metviewer/js/metviewer_common.js b/webapp/metviewer/js/metviewer_common.js index 69a8bfe4..451887ed 100644 --- a/webapp/metviewer/js/metviewer_common.js +++ b/webapp/metviewer/js/metviewer_common.js @@ -6245,8 +6245,13 @@ function requestDBUpdate() { }, success: function (data) { categories = $(data).find("groups").find('group'); + try { + $('#listdt').jqGrid('GridUnload'); + } + catch(err) { + + } - $('#listdt').jqGrid('GridUnload'); initPage(); } }); diff --git a/webapp/metviewer/js/metviewer_common.min.js b/webapp/metviewer/js/metviewer_common.min.js index a8564b02..d8ce74d3 100644 --- a/webapp/metviewer/js/metviewer_common.min.js +++ b/webapp/metviewer/js/metviewer_common.min.js @@ -282,7 +282,7 @@ b=[];var d=$(a[0]).attr("name");try{$("#fcst_var_y1_1").val(d).multiselect("refr $("#txtPlotCond").val(initXML.find("plot").find("plot_cond").text());d=$(initXML.find("plot").find("indep")[0]).attr("name");try{$("#indy_var").val(d).multiselect("refresh")}catch(f){}"fcst_init_beg"==d||"fcst_valid_beg"==d||"fcst_valid"==d||"fcst_init"==d?$("#date_period_button").css("display","block"):$("#date_period_button").css("display","none");var c=[];indy_var_vals_to_attr={};$(initXML.find("plot").find("indep")[0]).find("val").each(function(){c.push($(this).text());var a={};a.label=$(this)[0].attributes.label.nodeValue; a.plot_val=$(this)[0].attributes.plot_val.nodeValue;indy_var_vals_to_attr[$(this).text()]=a});0',error:function(a,b,d){},success:function(a){categories=$(a).find("groups").find("group");$("#listdt").jqGrid("GridUnload");initPage()}})} +function requestDBUpdate(){$.ajax({async:!1,url:"servlet",type:"POST",dataType:"xml",processData:!1,contentType:"application/xml",data:'',error:function(a,b,d){},success:function(a){categories=$(a).find("groups").find("group");try{$("#listdt").jqGrid("GridUnload")}catch(b){}initPage()}})} function updateFixVar(a){for(var b=fixed_var_indexes.slice(),d=0;d'+b+"")}):$.each(fix_var_value_to_title_mode_map, function(a,b){$("#fixed_var_"+e).append('")});try{$("#fixed_var_"+e).multiselect("uncheckAll"),$("#fixed_var_"+e).multiselect("refresh")}catch(c){}} function updateIndyVar(a){$("#indy_var").empty();"stat"==a?$.each(indy_var_value_to_title_stat_map,function(a,d){$("#indy_var").append('")}):$.each(indy_var_value_to_title_mode_map,function(a,d){$("#indy_var").append('")});try{$("#indy_var").multiselect("refresh")}catch(b){}$("#date_period").css("display","none")}String.prototype.endsWith=function(a){return-1!==this.indexOf(a,this.length-a.length)};