diff --git a/parts/server.py b/parts/server.py index d75ea63..03fe262 100644 --- a/parts/server.py +++ b/parts/server.py @@ -112,7 +112,7 @@ def alterLocation(locationID): @app.route('/parts/getpartinfo/') def get_part_info(partID): - s = 'select p.id,partno,description, c.name || l.name as location_descriptor, location_id, container_id datasheet from parts as p inner join locations as l on p.location_id = l.id inner join containers as c on l.container_id = c.id where p.id = :id;' + s = 'select p.id,partno,description, c.name || l.name as location_descriptor, location_id, container_id, datasheet from parts as p inner join locations as l on p.location_id = l.id inner join containers as c on l.container_id = c.id where p.id = :id;' r = db_engine.execute(text(s), id=partID) l = [] for row in r: diff --git a/parts/static/script.js b/parts/static/script.js index 21a0273..5fc881e 100644 --- a/parts/static/script.js +++ b/parts/static/script.js @@ -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(''); - }); - } + $.getJSON('parts/getlocationsInContainer/' + selected_container_id, 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 a5f7558..d52f23a 100644 --- a/parts/templates/partsearch.html +++ b/parts/templates/partsearch.html @@ -44,13 +44,13 @@
LOCATION

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