@@ -64,11 +64,11 @@ function EvaVariantWidget(args) {
6464
6565 this . browserGridConfig = {
6666 title : 'variant browser grid' ,
67- border : false
67+ border : true
6868 } ;
6969 this . toolPanelConfig = {
7070 title : 'Variant data' ,
71- border : false
71+ border : true
7272 } ;
7373 this . toolsConfig = {
7474 headerConfig : {
@@ -393,7 +393,7 @@ EvaVariantWidget.prototype = {
393393 target : target ,
394394 data : this . data ,
395395 height :450 ,
396- margin : '-8 0 0 0' ,
396+ margin : '5 0 0 0' ,
397397 border : this . browserGridConfig . border ,
398398 dataParser : this . dataParser ,
399399 responseRoot : this . responseRoot ,
@@ -431,7 +431,8 @@ EvaVariantWidget.prototype = {
431431 [ '25' ] ,
432432 [ '50' ] ,
433433 [ '75' ] ,
434- [ '100' ]
434+ [ '100' ] ,
435+ [ '200' ]
435436 ]
436437 } ) ,
437438 mode : 'local' ,
@@ -444,13 +445,14 @@ EvaVariantWidget.prototype = {
444445 forceSelection : true
445446 } ) ;
446447
447- variantBrowserGrid . grid . addTool ( {
448+ variantBrowserGrid . grid . addDocked ( {
448449 xtype : 'toolbar' ,
449450 dock : 'bottom' ,
450451 border :false ,
451452 items : [ 'Results per Page: ' , resultsPerPage , {
452453 xtype : 'button' ,
453454 text : 'Export as CSV' ,
455+ margin : '5 10 10 10' ,
454456 listeners : {
455457 click : {
456458 element : 'el' , //bind to the underlying el property on the panel
@@ -541,7 +543,7 @@ EvaVariantWidget.prototype = {
541543// _this.grid.setLoading(false);
542544 }
543545 } ,
544- height :1800 ,
546+ height :800 ,
545547 statsTpl : new Ext . XTemplate (
546548 '<table class="ocb-attributes-table">' +
547549 '<tr>' +
@@ -610,7 +612,7 @@ EvaVariantWidget.prototype = {
610612// _this.grid.setLoading(false);
611613 }
612614 } ,
613- height :2400 ,
615+ height :800 ,
614616 statsTpl : new Ext . XTemplate (
615617 '<table class="table table-bordered ocb-attributes-table">' +
616618 '<tr>' +
@@ -672,7 +674,7 @@ EvaVariantWidget.prototype = {
672674 align : 'stretch'
673675 }
674676 } ,
675- height :3200 ,
677+ height :800 ,
676678 handlers : {
677679 "load:finish" : function ( e ) {
678680
@@ -978,15 +980,32 @@ EvaVariantWidget.prototype = {
978980 /* Put the record object in somma seperated format */
979981 csvContent += snewLine ;
980982 Ext . Object . each ( records [ i ] . data , function ( key , value ) {
983+ if ( key == 'consequenceTypes' ) {
984+ var consqTypeArr = [ ] ;
985+ Ext . Object . each ( records [ i ] . data [ key ] , function ( k , v ) {
986+ consqTypeArr . push ( v . soTerms [ 0 ] . soName )
987+ } ) ;
988+ value = consqTypeArr . join ( " " ) ;
989+ }
981990 if ( _ . indexOf ( removeKeys , key ) == - 1 ) {
982991 printableValue = ( ( noCsvSupport ) && value == '' ) ? ' ' : value ;
983992 printableValue = String ( printableValue ) . replace ( / , / g , "" ) ;
984993 printableValue = String ( printableValue ) . replace ( / ( \r \n | \n | \r ) / gm, "" ) ;
985994 csvContent += sdelimiter + printableValue + edelimiter ;
986995 }
987996 } ) ;
988- var speciesName = _ . findWhere ( speciesList , { taxonomyCode :params . species . split ( '_' ) [ 0 ] } ) . taxonomyEvaName ;
989- var species = speciesName . substr ( 0 , 1 ) . toUpperCase ( ) + speciesName . substr ( 1 ) + '/' + _ . findWhere ( speciesList , { taxonomyCode :params . species . split ( '_' ) [ 0 ] } ) . assemblyName ;
997+
998+ console . log ( csvContent )
999+ var speciesName ;
1000+ var species ;
1001+ if ( ! _ . isEmpty ( speciesList ) ) {
1002+ speciesName = _ . findWhere ( speciesList , { taxonomyCode :params . species . split ( "_" ) [ 0 ] } ) . taxonomyEvaName ;
1003+ species = speciesName . substr ( 0 , 1 ) . toUpperCase ( ) + speciesName . substr ( 1 ) + '/' + _ . findWhere ( speciesList , { taxonomyCode :params . species . split ( '_' ) [ 0 ] } ) . assemblyName ;
1004+
1005+ } else {
1006+ species = params . species ;
1007+ }
1008+
9901009// var species = _.findWhere(speciesList, {value:params.species}).name;
9911010 speciesValue = ( ( noCsvSupport ) && species == '' ) ? ' ' : species ;
9921011 speciesValue = String ( species ) . replace ( / , / g , "" ) ;
0 commit comments