5 $genotyping_plate_format => '96'
8 <& /util/import_javascript.mas, classes => [ ] &>
11 <div id="trial_plate_layout_html">
19 jQuery(document).ready(function () {
22 url : '/ajax/breeders/trial/'+<% $trial_id %>+'/design',
23 beforeSend: function() {
24 jQuery("#working_modal").modal("show");
26 success: function(response){
27 //console.log(response);
28 jQuery("#working_modal").modal("hide");
29 var trial_plate_layout_html = "<table class='table table-hover table-condensed table-bordered' id='trial_plate_layout_table'><thead><tr><th>Well</th><th>Accession Name</th></tr></thead><tbody>";
32 if (<% $genotyping_plate_format %> == '96'){
35 if (<% $genotyping_plate_format %> == '384'){
40 if (<% $genotyping_plate_format %> == '96'){
41 rows = "ABCDEFGH".split("");
43 if (<% $genotyping_plate_format %> == '384'){
44 rows = "ABCDEFGHIJKLMNOP".split("");
47 jQuery.each(rows, function(row) {
48 for (col=1; col<col_max; col++) {
49 var formatted_col = (col < 10 ? '0' : '') + col;
50 var well = rows[row] + formatted_col;
51 if (response.design[well]) {
52 if (response.design[well].accession_name) {
53 var accession_name = response.design[well].accession_name;
54 trial_plate_layout_html = trial_plate_layout_html + "<tr><td>" + well + "</td><td>" + accession_name + "</td></tr>";
60 trial_plate_layout_html = trial_plate_layout_html + "</tbody></table>";
61 jQuery('#trial_plate_layout_html').empty();
62 jQuery('#trial_plate_layout_html').html(trial_plate_layout_html);
63 jQuery('#trial_plate_layout_table').DataTable();
65 error: function(response){
66 jQuery("#working_modal").modal("hide");
67 alert("Error retrieving plate layout.");