Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ Gemma.ExpressionExperimentPage = Ext.extend( Ext.TabPanel, {
}
},

checkData: function( eeId, geneList, callback ){
// checks to see if a dataset has expression data to prevent the relevant tabs from
// being shown
var store = new Gemma.VisualizationStore()
store.on( 'exception', function( e,type, action, options, response, arg ){
Ext.callback(callback,this,[false])
})

store.load({
params: [ [ eeId ], geneList || [] ],
callback: function (records, options, success) {
var hasData = !!(success && records && records.length > 0);
callback(hasData);
},
scope: this
});

},

/**
* @memberOf Gemma.ExpressionExperimentPage
*/
Expand Down Expand Up @@ -148,12 +167,18 @@ Gemma.ExpressionExperimentPage = Ext.extend( Ext.TabPanel, {

// EXPERIMENT DESIGN TAB
this.add( this.makeDesignTab( experimentDetails ) );
this.checkData(experimentDetails.id,[],function(hasData){
if(hasData){
// VISUALISATION TAB
this.add( this.makeVisualisationTab( experimentDetails, isAdmin ) );

// DIAGNOSTICS TAB
this.add( this.makeDiagnosticsTab( experimentDetails, isAdmin ) );
}
}.createDelegate(this))


// VISUALISATION TAB
this.add( this.makeVisualisationTab( experimentDetails, isAdmin ) );

// DIAGNOSTICS TAB
this.add( this.makeDiagnosticsTab( experimentDetails, isAdmin ) );

this.adjustForIsAdmin( isAdmin, this.editable );

Expand Down Expand Up @@ -208,6 +233,8 @@ Gemma.ExpressionExperimentPage = Ext.extend( Ext.TabPanel, {
};
},



makeVisualisationTab : function( experimentDetails, isAdmin ) {
var eeId = this.eeId;
var title = "Data for a 'random' sampling of probes";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ Gemma.VisualizationStore = function( config ) {
}, this.record );

Gemma.VisualizationStore.superclass.constructor.call( this, config );

this.relayEvents( this.proxy, [ 'loadexception' ] );

};
Expand All @@ -1210,7 +1210,14 @@ Gemma.VisualizationStore = function( config ) {
* @extends Ext.data.Store
*/

Ext.extend( Gemma.VisualizationStore, Ext.data.Store, {} );
Ext.extend( Gemma.VisualizationStore, Ext.data.Store, {
loadRecords: function(o, options,success){
if (!o.records){
o.records = []
}
return Gemma.VisualizationStore.superclass.loadRecords.call(this,o, options, success)
}
} );

// //////////////////////////////////////////////////////////////////////////////////

Expand Down