Commit e92a9511 authored by Julien Wollbrett's avatar Julien Wollbrett

solve bug of sorting expression comparison page. Fix #218

parent 4b82a0cf
......@@ -409,6 +409,7 @@ public class HtmlExpressionComparisonDisplay extends HtmlParentDisplay
if (!this.prop.isMinify()) {
this.includeJs("lib/jquery_plugins/jquery.dataTables.min.js");
this.includeJs("lib/jquery_plugins/dataTables.responsive.min.js");
this.includeJs("lib/jquery_plugins/dataTables.sort.min.js");
this.includeJs("expr_comp.js");
} else {
this.includeJs("lib/jquery_plugins/vendor_expr_comp.js");
......
......@@ -65,7 +65,9 @@ $( document ).ready( function(){
{ responsivePriority: 1, targets: 0 }, // Anatomical entities
{ responsivePriority: 1, targets: 1 }, // Score
{ responsivePriority: 1, targets: 2 }, // Min rank
{ type: 'scientific', targets: 2 }, // sort using the scientific type
{ responsivePriority: 2, targets: 3 }, // Gene count with presence of expression
{ type: 'gene-number', targets: 3 }, // sort using the gene-number type
{ responsivePriority: 2, targets: 4 }, // Gene count with absence of expression
{ responsivePriority: 2, targets: 5 }, // Gene count with no data
{ responsivePriority: 3, targets: 6 }, // Species count with presence of expression
......@@ -119,10 +121,12 @@ $( document ).ready( function(){
{ responsivePriority: 1, targets: 0 }, // Anatomical entities
{ responsivePriority: 1, targets: 1 }, // Score
{ responsivePriority: 1, targets: 2 }, // Min rank
{ type: 'scientific', targets: 2 }, // sort using the scientific type
{ responsivePriority: 2, targets: 3 }, // Gene count with presence of expression
{ type: 'gene-number', targets: 3 }, // sort using the gene-number type
{ responsivePriority: 2, targets: 4 }, // Gene count with absence of expression
{ responsivePriority: 2, targets: 5 }, // Gene count with no data
{ responsivePriority: 2, targets: 6 } // Details
{ responsivePriority: 2, targets: 6 } // Details
],
columns: [ // sorting definition
{ "orderable": true }, // Anatomical entities
......
_geneNumberSort=function(e,n,r){var t=/^(.*) gene/;return(e=null!==(e=e.replace(",",".").match(t))?parseFloat(e[0]):r)<(n=null!==(n=n.replace(",",".").match(t))?parseFloat(n[0]):r)?-1:e>n?1:0},jQuery.extend(jQuery.fn.dataTableExt.oSort,{"scientific-pre":function(e){return parseFloat(e)},"scientific-asc":function(e,n){return e<n?-1:e>n?1:0},"scientific-desc":function(e,n){return e<n?1:e>n?-1:0},"gene-number-asc":function(e,n){return _geneNumberSort(e,n,Number.POSITIVE_INFINITY)},"gene-number-desc":function(e,n){return-1*_geneNumberSort(e,n,Number.NEGATIVE_INFINITY)}});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment