Fixed dropdown population order

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

@ -169,8 +169,9 @@ function delete_entry(partID) {
function show_part_info(partID) { function show_part_info(partID) {
$.getJSON(rootURL + 'getpartinfo/' + partID, function(data) { $.getJSON(rootURL + 'getpartinfo/' + partID, function(data) {
$('table#details tr#location td p').text(text_filter(data.location_descriptor)); // name is the location friendly name $('table#details tr#location td p').text(text_filter(data.location_descriptor)); // name is the location friendly name
$('#location-dropdown').val(data.location_id);
$('#container-dropdown').val(data.container_id); $('#container-dropdown').val(data.container_id);
container_onchange();
$('#location-dropdown').val(data.location_id);
$('table#details tr#partno td p').text(text_filter(data.partno)); $('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#partno td input').val(text_filter(data.partno));
$('table#details tr#description td p').text(text_filter(data.description)); $('table#details tr#description td p').text(text_filter(data.description));
@ -181,7 +182,6 @@ function show_part_info(partID) {
var $el = $('#datasheet-finput'); var $el = $('#datasheet-finput');
$el.wrap('<form>').closest('form').get(0).reset(); $el.wrap('<form>').closest('form').get(0).reset();
$el.unwrap(); $el.unwrap();
container_onchange();
if (data.datasheet != null) { if (data.datasheet != null) {
$('tr#datasheet-head').html($('<td>DATASHEET: <a href="' + data.datasheet + '" target="_blank"><i class="fa fa-file-text" aria-hidden="true"></i></a></td>')); $('tr#datasheet-head').html($('<td>DATASHEET: <a href="' + data.datasheet + '" target="_blank"><i class="fa fa-file-text" aria-hidden="true"></i></a></td>'));
$('input[name=datasheet-url-input]').val(data.datasheet); $('input[name=datasheet-url-input]').val(data.datasheet);

Loading…
Cancel
Save