Skip to content
Snippets Groups Projects
Commit c2f77660 authored by juanf's avatar juanf
Browse files

SSDM-983 : PAPER - Annotations on Batch Import

SVN: 32822
parent 83ae58f7
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,21 @@ function SampleTableController(parentController, title, experimentIdentifier) {
}
}
callback();
//Show samples when only one type available by default
var numSampleTypes = 0;
var defaultSampleType = null;
for(sampleTypeCode in _this._sampleTableModel.sampleTypes) {
if(numSampleTypes === 0) {
defaultSampleType = sampleTypeCode;
}
numSampleTypes++;
}
if(numSampleTypes === 1) {
_this._reloadTableWithSampleType(defaultSampleType);
_this._sampleTableView.getSampleTypeSelector().val(defaultSampleType);
}
});
}
......
......@@ -17,6 +17,7 @@ function SampleTableView(sampleTableController, sampleTableModel) {
this._sampleTableController = sampleTableController;
this._sampleTableModel = sampleTableModel;
this._tableContainer = $("<div>");
this.sampleTypeSelector = null;
this.repaint = function($container) {
$container.empty();
......@@ -43,6 +44,13 @@ function SampleTableView(sampleTableController, sampleTableModel) {
return this._tableContainer;
}
//
// Components
//
this.getSampleTypeSelector = function() {
return this.sampleTypeSelector;
}
//
// Menus
//
......@@ -82,11 +90,12 @@ function SampleTableView(sampleTableController, sampleTableModel) {
for(sampleTypeCode in this._sampleTableModel.sampleTypes) {
$sampleTypesSelector.append($('<option>', { 'value' : sampleTypeCode }).text(sampleTypeCode));
}
$sampleTypesSelector.change(function(event) {
var sampleTypeToShow = $(this).val();
_this._sampleTableController._reloadTableWithSampleType(sampleTypeToShow);
});
this.sampleTypeSelector = $sampleTypesSelector;
return $("<span>").append($sampleTypesSelector);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment