diff --git a/parts/static/script.js b/parts/static/script.js index 73c23a9..21a0273 100644 --- a/parts/static/script.js +++ b/parts/static/script.js @@ -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(''); + }); + } }); } diff --git a/parts/templates/partsearch.html b/parts/templates/partsearch.html index bd531ad..a5f7558 100644 --- a/parts/templates/partsearch.html +++ b/parts/templates/partsearch.html @@ -44,11 +44,14 @@
LOCATION

- {% for container in containers %} {% endfor %} +
PART NUMBER