Merge pull request #432 from mlorb/ml-sci-fix-847

Add dynamic length for sample type/group field when adding new sample [SCI-847]
This commit is contained in:
mz3944 2017-01-20 15:46:34 +01:00 committed by GitHub
commit fd63a1de12

View file

@ -458,10 +458,7 @@ function onClickEdit() {
});
// Adjust columns width in table header
table.columns.adjust();
$('.dropdown-menu').parent().on('shown.bs.dropdown hidden.bs.dropdown', function () {
table.columns.adjust();
});
adjustTableHeader();
},
error: function (e, data, status, xhr) {
if (e.status == 403) {
@ -746,7 +743,7 @@ function onClickAddSample() {
$("select[name=sample_type_id]").selectpicker();
// Adjust columns width in table header
table.columns.adjust();
adjustTableHeader();
},
error: function (e, eData, status, xhr) {
if (e.status == 403)
@ -787,6 +784,14 @@ function createTdElement(content) {
return td;
}
// Adjust columns width in table header
function adjustTableHeader() {
table.columns.adjust();
$('.dropdown-menu').parent().on('shown.bs.dropdown hidden.bs.dropdown', function () {
table.columns.adjust();
});
}
/**
* Creates select dropdown for sample type
* @param {Object[]} data List of sample types