Fixed setting location in dropdown on show_part_info

pull/3/head
Davide Bongiovanni 6 years ago
parent 97a208f48c
commit dac5d96f03

@ -170,8 +170,14 @@ function show_part_info(partID) {
$.getJSON(rootURL + 'getpartinfo/' + partID, function(data) {
$('table#details tr#location td p').text(text_filter(data.location_descriptor)); // name is the location friendly name
$('#container-dropdown').val(data.container_id);
container_onchange();
$('#location-dropdown').val(data.location_id);
$('img#map').attr('src', 'parts/map/' + data.container_id);
$('#location-dropdown').empty();
$.getJSON('parts/getlocationsInContainer/' + data.container_id, function(json) {
$.each(data, function(loc_id, loc_name) {
$('#location-dropdown').append('<option value="' + loc_id + '">' + loc_name + '</option>');
});
$('#location-dropdown').val(data.location_id);
});
$('table#details tr#partno td p').text(text_filter(data.partno));
$('table#details tr#partno td input').val(text_filter(data.partno));
$('table#details tr#description td p').text(text_filter(data.description));

Loading…
Cancel
Save