Added container dropdown. Modified container-dropdown onchange event.

This commit is contained in:
2018-11-11 20:45:08 +01:00
parent 3788060c78
commit 863ce49e98
2 changed files with 19 additions and 5 deletions
+15 -4
View File
@@ -186,10 +186,21 @@ function perform_query() {
});
}
function update_map() {
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);
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>');
});
}
});
}