Fixed minor issues

This commit is contained in:
2018-11-11 20:58:08 +01:00
parent 2efb06ef3c
commit 6670487ac0
3 changed files with 7 additions and 14 deletions
+4 -11
View File
@@ -187,20 +187,13 @@ function perform_query() {
}
function container_onchange() {
// var selected_id = $('table#details tr#location td select').val();
// $.ajax('parts/getlocationURL/' + selected_id).done( function(data) {
// $('img#map').attr('src', 'parts/map/' + data);
// });
var selected_container_id = $('#container-dropdown').val();
$('img#map').attr('src', 'parts/map/' + selected_container_id);
$('#location-dropdown').empty();
$.ajax({
url:'parts/getlocationsInContainer/',
success: function(data) {
$.each(data, function(location_id, location_name) {
$('#location-dropdown').append('<option val="' + location_id + '">' + location_name + '</option>');
});
}
$.getJSON('parts/getlocationsInContainer/' + selected_container_id, function(data) {
$.each(data, function(location_id, location_name) {
$('#location-dropdown').append('<option val="' + location_id + '">' + location_name + '</option>');
});
});
}