6 <&| /page/info_section.mas, title => 'Transformants (Accessions) Derived from this Transformation ', collapsible=>1, collapsed=>0 &>
7 <div class = "well well-sm">
8 <div class = "panel panel-default">
9 <div class = "panel-body">
10 <div style="overflow:scroll">
11 <table class="table table-hover table-bordered" id="transformants_table">
14 <div class="panel panel-default">
15 <div class="panel-body">
16 <&| /page/info_section.mas, title => 'Add transformants (accessions) to a List', collapsible=>1, collapsed=>1, subtitle=>'<i>Adding transformants (accessions) to a new or exisiting list</i>'&>
18 <div id="transformant_to_new_list" style="display:none"></div>
19 <div id="transformant_add_to_list"></div>
30 jQuery(document).ready(function(){
32 const transformation_stock_id = "<%$transformation_id%>";
33 const transformants_table = jQuery('#transformants_table').DataTable({
34 'ajax': '/ajax/transformation/transformants/'+transformation_stock_id,
37 { title: "Accession", "data": null, "render": function ( data, type, row ) { return "<a href='/stock/"+row.transformant_id+"/view'>"+row.transformant_name+"</a>"; } },
38 { title: "Obsolete Accession", "data": "null", "render": function ( data, type, row ) { return "<a onclick='obsoleteTransformant("+row.transformant_id+",\""+row.transformant_name+"\")'>X</a>"; } },
41 "fnInitComplete": function(oSettings, json) {
44 jQuery('#transformant_add_to_list').html("<div class='well well-sm'><h3>Please login to use lists!</h3></div>");
47 for(let i=0; i<json.data.length; i++){
48 html += json.data[i].transformant_name+"\n";
51 jQuery("#transformant_to_new_list").html(html);
52 addToListMenu("transformant_add_to_list", "transformant_to_new_list", {
54 listType: 'accessions',
63 function obsoleteTransformant(transformant_id, transformant_name){
64 const confirmation = confirm('Are you sure you want to obsolete this transformant?' + " " + transformant_name);
68 url : '/stock/obsolete?stock_id='+transformant_id+'&is_obsolete=1',
69 beforeSend : function() {
70 jQuery('#working_modal').modal('show');
72 success: function(response){
73 console.log(response);
74 jQuery('#working_modal').modal('hide');
75 alert('Successfully obsoleted!');
78 error: function(response){
79 jQuery('#working_modal').modal('hide');
80 alert("Error obsoleting transformants.");