-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Hi @ethan92429!
Just wanted to give you an update of my overall task at the moment. I'm trying to give users the ability to choose what data is displayed on the website by either choosing day, week, month, or year which will result in different queries when the function updatePlantData is called. To do this, I've added some buttons but I'm having trouble getting the functionality to work properly.
I was wondering if you could explain this chunk of code to me. It's in index.html. Right now, my main issue is that I need to pass codeList as a parameter into updatePlantData, but I can't figure out how to do that since it's defined in the block of code I pasted below. I'm thinking either that is the issue, or that you can't just call updatePlantData and expect it to update. Any help would be appreciated, thanks!
*Since this is a pretty complex problem, I'd be open for a call to work through it if you have time! I'll be in the AguaClara lab starting at 4:30 today
$(document).ready(function() {
submitRadioValues = function(){
plantCode = $('input[name="plantSelection"]:checked').val();
save("plantName", plantCode);
$("#allPlantsDropDown").html("");
connectSyncButton();
codeList = [plantCode];
initViz(codeList);
$("#datosHeader").html("Datos Sobre la Planta de "+plantCode);
$("#syncButtonDiv").html("<a id='sync-viz' class='waves-effect waves-light btn'>Sincronizar</a>");
connectSyncButton();
addSpinner('#spinnerDestination');
updatePlantData(visualize, codeList, "month");
$("#selectPrompt").html("");
}
if (getPlantName()==null){
window.location.replace("/settings.html");
}else{
$("#selectPrompt").html("");
$("#syncButtonDiv").html("<a id='sync-viz' class='waves-effect waves-light btn'>Sincronizar</a>");
var codeList = [getPlantName()]; //list of currently chosen plants (by code)
connectSyncButton();
initViz(codeList);
addSpinner('#spinnerDestination');
updatePlantData(visualize, codeList, "month");
}
});