diff --git a/SolarPower/Views/StationOverview/Index.cshtml b/SolarPower/Views/StationOverview/Index.cshtml index da41265..2925935 100644 --- a/SolarPower/Views/StationOverview/Index.cshtml +++ b/SolarPower/Views/StationOverview/Index.cshtml @@ -366,6 +366,22 @@ getStation(ids); }) + function emptyCardAndTable() { + $('#areaCard').empty(); + $('#solarTable').find('tbody').empty(); + $("#today_kwh").html(0); + $("#total_kwh").html(0); + $("#today_irradiance").html(0); + $("#avg_irradiance").html(0); + $("#today_PR").html(0); + $("#avg_PR").html(0); + $("#today_kwhkwp").html(0); + $("#avg_kwhkwp").html(0); + $("#today_carbon").html(0); + $("#total_carbon").html(0); + $("#update_at").html(0); + } + function getStation(ids) { @*var kwh = $('#kwh_order').val(); var pr = $('#pr_order').val(); @@ -387,26 +403,13 @@ prOrderBy: $('#pr_order').val() } + emptyCardAndTable(); + @*ids.sort(function (a, b) { return a - b; }); ids.sort();*@ - if (ids.length == 0 || selectedStatus.length == 0) { - $('#areaCard').empty(); - $('#solarTable').find('tbody').empty(); - $("#today_kwh").html(0); - $("#total_kwh").html(0); - $("#today_irradiance").html(0); - $("#avg_irradiance").html(0); - $("#today_PR").html(0); - $("#avg_PR").html(0); - $("#today_kwhkwp").html(0); - $("#avg_kwhkwp").html(0); - $("#today_carbon").html(0); - $("#total_carbon").html(0); - $("#update_at").html(0); - } - else { + if (ids.length != 0 && selectedStatus.length != 0) { showLoading(); var Nurl = "/StationOverview/GetPowerStationByFilter"; $.post(Nurl, send_data, function (rel) {