anchor.diff:                          "sSearch": "Filter: ",
                           "sInfo": "Showing _START_ to _END_ of _TOTAL_ genes (for complete dataset of your search, please use export buttons)"
                       },
  -                   /*  "columnDefs": [                
  -                        { "type": "alt-string", targets: 3 }   //4th col sorted using alt-string         
  -                    ], */
  -                    "aaSorting": [[ 0, "asc" ]],  // default sort column order, won't work if bSort is false
  +                    /*  "columnDefs": [
  +                         { "type": "alt-string", targets: 3 }   //4th col sorted using alt-string
  +                     ], */
  +                    "aaSorting": [[0, "asc"]],  // default sort column order, won't work if bSort is false
                       /*"aoColumns": [
                           {"bSearchable": true, "sType": "html", "bSortable": true},
                           {"bSearchable": true, "sType": "string", "bSortable": true},
  
positive.code:                     ],*/
                      "fnDrawCallback": function (oSettings) {  // when dataTable is loaded
  
                      	$('div#sec2').show();
                      
                      	document.getElementById('sec2').scrollIntoView(true); // scrolls to results when datatable loads
                      
                      	var endPoint = baseUrl + '/bqExport';	
                      	
                      	$('div#tableTool').html("<span id='expoWait'></span><form id='dnld' method='POST' action='" + endPoint + "'>"
                      		+ "<span class='export2'>Export full dataset as</span>"
                          	+ "<input name='coreName' value='' type='hidden' />"
                         		+ "<input name='fileType' value='' type='hidden' />"
                         		+ "<input name='gridFields' value='' type='hidden' />"
                         		+ "<input name='idList' value='' type='hidden' />"
                         		+ "<button class='tsv fa fa-download gridDump'>TSV</button>"
                         		+ " or<button class='xls fa fa-download gridDump'>XLS</button>"
                         		+ "</form>");
                     		
                     		$('button.gridDump').click(function(){
                      		
                      		var fllist = fetchSelectedFieldList();
                      		var errMsg = 'AJAX error trying to export dataset';
                      		var currDataType = $('input.bq:checked').attr('id');
                      		var idList = null;
                      		var fileType = $(this).hasClass('tsv') ? 'tsv' : 'xls';
                      		
                      		var formId = $('div#accordion').find('form:visible').attr('id');   
                      		var isForm = false;
                      		
                      		if ( formId == 'ajaxForm' ){ 
                      			isForm = true;
                      			$("#ajaxForm").ajaxForm({
                      				url: baseUrl + '/batchQuery?dataType=' + currDataType,
              	                	success:function(jsonStr) { 
              	                		var j = JSON.parse(jsonStr);
              	                		idList = j.goodIdList;
              	                		doExport(currDataType, fileType, fllist, idList, isForm);
              	                 	},
              	                 	dataType:"text",
              	                 	type: 'POST',
              	               	}).submit();
                      		}
                      		else if ( formId == 'pastedIds' ){
                      			idList = parsePastedList($('textarea#pastedList').val(), currDataType);
                      			doExport(currDataType, fileType, fllist, idList, isForm);
                      		}
                      		else {
                      			idList = '*';
                      			doExport(currDataType, fileType, fllist, idList, isForm);
                      		}
                      		
                      		if (formId == 'ajaxForm' ){
                      			return false; 
                      		}
                     		});
                          
                          $('body').removeClass('footerToBottom'); 
                      },
                      "ajax": {
                          "url": baseUrl + "/dataTable_bq?",
                          "data": oConf,
                          "type": "POST",
                          "error": function() {
                              $('div.dataTables_processing').text("Failed to fetch your query: keyword not found");
                              $('td.dataTables_empty').text("");
                          }
                      }
                  });
              }
              function doExport(currDataType, fileType, fllist, idList, isForm, phenoSimilarity_id, phenoSimilarity_term,
      			wantHumanCurated_id, wantHumanCurated_term){
              	
              	// deals with duplicates
              	if ( idList.split(",").length > 500 ){
              		var isOk = window.confirm("Please be aware that you have submitted > 500 identifiers and it will take longer to download\n\nWould you like to proceed?");
              		if ( !isOk ){
              			return false; // won't do the rest
              		}
              	}
              	
              	idList = getUniqIdsStr(idList);
              	
              	$("form#dnld input[name='coreName']").val(currDataType);
          		$("form#dnld input[name='fileType']").val(fileType);
          		$("form#dnld input[name='gridFields']").val(fllist);
          		$("form#dnld input[name='idList']").val(idList);
          		
          		if ( isForm ) {
          			$('button').unbind('click');
          			$("form#dnld").submit();
          			/*
          			$('button.xls').click(function() { 
          			    // submit the form 
          			    $("form#dnld").ajaxSubmit(); 
          			    // return false to prevent normal browser submit and page navigation 
          			    return false; 
          			});*/
          		}
              }
  
  
  			// submit query
  
              
          </script>
         
          <script type="text/javascript" src="${baseUrl}/js/vendor/jquery/jquery.form.js"></script>
          <script type='text/javascript' src='https://bartaz.github.io/sandbox.js/jquery.highlight.js'></script>  
          <script type='text/javascript' src='https://cdn.datatables.net/plug-ins/f2c75b7247b/features/searchHighlight/dataTables.searchHighlight.min.js'></script>  
          <script type='text/javascript' src='${baseUrl}/js/utils/tools.js'></script>  
  
      </jsp:attribute>
  
negative.code: 
      </jsp:attribute>
  
      <jsp:body>
          <div class="container data-heading">
              <div class="row row-shadow">
                  <div class="col-12 no-gutters">
                      <h2>IMPC Dataset Batch Query</h2>
                  </div>
              </div>
          </div>
  
  
          <div class="container single single--no-side">
              <div class="row row-over-shadow">
                  <div class="col-12 white-bg">
                      <div class="page-content pt-5 pb-5">
                          <div class="section">
  
                              <!--  <h2 id="section-gostats" class="title ">IMPC Dataset Batch Query</h2>-->
                              <div class='inner' id='srchBlock'>
  
                                  <div class='fl2'>
  
                                      <h6 class='bq'>Customized Output</h6>
                                      <div id='fieldList'>${outputFields}</div>
                                  </div>
  
                                  <div class='fl1'>
                                      <h6 class='bq'>Datatype Input</h6>
                                      <div id='query'>
                                          <table id='dataInput'>
                                              <tr>
                                                  <td><span class='cat'>ID:</span></td>
                                                  <td><input type="radio" id="gene" value="MGI:106209" name="dataType"
                                                             class='bq' checked="checked">IMPC Gene
                                                      <input type="radio" id="ensembl" value="ENSMUSG00000011257"
                                                             name="dataType" class='bq'>Ensembl Gene
                                                      <input type="radio" id="mp" value="MP:0001926" name="dataType"
                                                             class='bq'>MP
                                                      <input type="radio" id="hp" value="HP:0000400" name="dataType"
                                                             class='bq'>HP<br>
                                                      <input type="radio" id="disease"
                                                             value="OMIM:100300 or ORPHA:93 or DECIPHER:17"
                                                             name="dataType" class='bq'>OMIM / ORPHANET / DECIPHER
                                                      <input type="radio" id="anatomy"
                                                             value="MA:0003077 or EMAPA:35955 (ok to mix)" name="dataType"
                                                             class='bq'>ANATOMY
                                                  </td>
                                              </tr>
                                              <tr>
                                                  <td><span class='cat'>Symbol:</span></td>
                                                  <td><input type="radio" id="human_marker_symbol"
                                                             value="Ca4 or CA4 (case insensitive). Synonym search supported"
                                                             name="dataType" class='bq'>Human Marker Symbol
                                                      <input type="radio" id="mouse_marker_symbol"
                                                             value="Car4 or CAR4 (case insensitive). Synonym search supported"
                                                             name="dataType" class='bq'>Mouse Marker Symbol
                                                  </td>
                                              <tr>
                                                  <td><span class='cat'>Example:</span></td>
                                                  <td class='note idnote'>MGI:106209</td>
                                              </tr>
                                          </table>
  
                                          <div id="accordion">
                                              <p class='header'>Paste in your list</p>
                                              <div>
                                                  <p>
                                                      <form id='pastedIds'>
                                                          <textarea id='pastedList' rows="5" cols="50"></textarea>
                                                          <input type="submit" id="pastedlist" name="" value="Submit"
                                                                 onclick="return submitPastedList()"/>
                                                          <input type="reset" name="reset" value="Reset">
                                                  <p>
                                                  <p class='notes'>Supports space, comma, tab or new line separated
                                                      identifier list</p>
                                                  <p class='notes'>Please DO NOT submit a mix of identifiers from different datatypes</p>
                                                  </form>
                                                  </p>
                                              </div>
                                              <p class='header'>Upload your list from file</p>
                                              <div>
  
                                                  <form id="ajaxForm" method="post" action="${baseUrl}/batchQuery"
                                                        enctype="multipart/form-data">
                                                      <!-- File input -->
                                                      <input name="fileupload" id="fileupload" type="file"/><br/>
                                                      <input name="dataType" id="dtype" value="" type="hidden"/><br/>
                                                      <input type="submit" id="upload" name="upload" value="Upload"
                                                             onclick="return uploadJqueryForm()"/>
                                                      <input type="reset" name="reset" value="Reset">
                                                      <p>
                                                      <p class='notes'>Supports comma, tab or new line separated
                                                          identifier list</p>
                                                      <p class='notes'>Please DO NOT submit a mix of identifiers from
                                                          different datatypes</p>
                                                  </form>
  
                                              </div>
                                              <p class='header'>Full dataset</p>
                                              <form>
                                                  <div id='fullDump'></div>
                                                  Please use our <a id='ftp'
                                                                    href='ftp://ftp.ebi.ac.uk/pub/databases/impc/'
                                                                    target='_blank'>FTP</a> site for large dataset.
                                              </form>
                                          </div>
  
                                      </div>
  
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
          </div>
  
  
          <div class="container" id="expression">
              <div class="row">
                  <div class="col-12 no-gutters">
                      <h3><i class="fa fa-table"></i>&nbsp;Results</h3>
                  </div>
              </div>
          </div>
  
  
          <div class="container single single--no-side">
              <div class="row">
                  <div class="col-12 white-bg">
                      <div class="page-content pt-5 pb-5">
                          <div class="inner">
                              <div class="section" id="sec2">
                                  <div class="inner">
                                      <div id='infoBlock'></div>
                                      <div id='errBlock'></div>
                                      <div id='bqResult'></div>
                                  </div>
                              </div>
  
                          </div>
                      </div>
                  </div>
              </div>
  
              <%--div class="rcontainer single single--no-side">
                  <div class="block block-system">
                      <div class="content">
                          <div class="node node-gene">
                              <h1 class="title" id="top">IMPC Dataset Batch Query<a id="bqdoc" class=""><i
                                      class="fa fa-question-circle pull-right"></i></a></h1>
  
                              <div class="section">
  
                                  <!--  <h2 id="section-gostats" class="title ">IMPC Dataset Batch Query</h2>-->
                                  <div class='inner' id='srchBlock'>
  
                                      <div class='fl2'>
  
                                          <h6 class='bq'>Customized Output</h6>
                                          <div id='fieldList'>${outputFields}</div>
                                      </div>
  
                                      <div class='fl1'>
                                          <h6 class='bq'>Datatype Input</h6>
                                          <div id='query'>
                                              <table id='dataInput'>
                                                  <tr>
                                                      <td><span class='cat'>ID:</span></td>
                                                      <td><input type="radio" id="gene" value="MGI:106209" name="dataType"
                                                                 class='bq' checked="checked">IMPC Gene
                                                          <input type="radio" id="ensembl" value="ENSMUSG00000011257"
                                                                 name="dataType" class='bq'>Ensembl Gene
                                                          <input type="radio" id="mp" value="MP:0001926" name="dataType"
                                                                 class='bq'>MP
                                                          <input type="radio" id="hp" value="HP:0000400" name="dataType"
                                                                 class='bq'>HP<br>
                                                          <input type="radio" id="disease"
                                                                 value="OMIM:100300 or ORPHA:93 or DECIPHER:17"
                                                                 name="dataType" class='bq'>OMIM / ORPHANET / DECIPHER
                                                          <input type="radio" id="anatomy"
                                                                 value="MA:0003077 or EMAPA:35955 (ok to mix)"
                                                                 name="dataType"
                                                                 class='bq'>ANATOMY
                                                      </td>
                                                  </tr>
                                                  <tr>
                                                      <td><span class='cat'>Symbol:</span></td>
                                                      <td><input type="radio" id="human_marker_symbol"
                                                                 value="Ca4 or CA4 (case insensitive). Synonym search supported"
                                                                 name="dataType" class='bq'>Human Marker Symbol
                                                          <input type="radio" id="mouse_marker_symbol"
                                                                 value="Car4 or CAR4 (case insensitive). Synonym search supported"
                                                                 name="dataType" class='bq'>Mouse Marker Symbol
                                                      </td>
                                                  <tr>
                                                      <td><span class='cat'>Example:</span></td>
                                                      <td class='note idnote'>MGI:106209</td>
                                                  </tr>
                                              </table>
  
                                              <div id="accordion">
                                                  <p class='header'>Paste in your list</p>
                                                  <div>
                                                      <p>
                                                          <form id='pastedIds'>
                                                              <textarea id='pastedList' rows="5" cols="50"></textarea>
                                                              <input type="submit" id="pastedlist" name="" value="Submit"
                                                                     onclick="return submitPastedList()"/>
                                                              <input type="reset" name="reset" value="Reset">
                                                      <p>
                                                      <p class='notes'>Supports space, comma, tab or new line separated
                                                          identifier list</p>
                                                      <p class='notes'>Please DO NOT submit a mix of identifiers from
                                                          different datatypes</p>
                                                      </form>
                                                      </p>
                                                  </div>
                                                  <p class='header'>Upload your list from file</p>
                                                  <div>
  
                                                      <form id="ajaxForm" method="post" action="${baseUrl}/batchQuery"
                                                            enctype="multipart/form-data">
                                                          <!-- File input -->
                                                          <input name="fileupload" id="fileupload" type="file"/><br/>
                                                          <input name="dataType" id="dtype" value="" type="hidden"/><br/>
                                                          <input type="submit" id="upload" name="upload" value="Upload"
                                                                 onclick="return uploadJqueryForm()"/>
                                                          <input type="reset" name="reset" value="Reset">
                                                          <p>
                                                          <p class='notes'>Supports comma, tab or new line separated
                                                              identifier list</p>
                                                          <p class='notes'>Please DO NOT submit a mix of identifiers from
                                                              different datatypes</p>
                                                      </form>
  
                                                  </div>
                                                  <p class='header'>Full dataset</p>
                                                  <form>
                                                      <div id='fullDump'></div>
                                                      Please use our <a id='ftp'
                                                                        href='ftp://ftp.ebi.ac.uk/pub/databases/impc/'
                                                                        target='_blank'>FTP</a> site for large dataset.
                                                      <!-- <input type="submit" id="fulldata" name="" value="Submit" onclick="return fetchFullDataset()" /><p> -->
                                                  </form>
                                              </div>
  
                                          </div>
  
                                      </div>
                                  </div>
  
                                  <div style="clear: both"></div>
  
                              </div>
  
                          </div><!-- end of section -->
                          <div class="section" id="sec2">
                              <h2 id="section-gotable" class="title ">Batch Query Result</h2>
  
                              <div class="inner">
                                  <div id='infoBlock'></div>
                                  <div id='errBlock'></div>
                                  <div id='bqResult'></div>
  
                              </div>
                          </div>
                      </div>
                  </div>
              </div--%>
          </div>
  
      </jsp:body>
  </t:genericpage>
  