6 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables' ] &>
8 <& /page/page_title.mas, title=>'Search Accessions Containing Specific Genotypes' &>
11 <&| /page/info_section.mas, title=>'Step 1: Select a set of accessiions (dataset)'&>
12 <div class="row" id="search_form_1" >
13 <div class="col-sm-1">
15 <div class="col-sm-12 well">
16 <span style="width:240px" id="dataset_accessions"></span>
22 <&| /page/info_section.mas, title=>'Step 1:'&>
23 <div class="row" id="search_form_1" >
24 <div class="col-sm-1">
26 <div class="col-sm-12 well">
28 <div class="col-sm-11">
29 <div class="form-horizontal">
30 <div class="form-group">
31 <label class="control-label col-sm-4">Select a list of accessions:</label>
32 <div class="col-sm-8" >
33 <div class="input-group">
34 <select class="form-control" id="stock_list_select">
35 <option value="">Select a list of accessions</option>
48 <&| /page/info_section.mas, title=>'Step 2:'&>
49 <div class="row" id="search_form_2" >
50 <div class="col-sm-1">
52 <div class="col-sm-12 well">
54 <div class="col-sm-11">
55 <div class="form-horizontal">
56 <div class="form-group">
57 <label class="control-label col-sm-4">Select a set of markers (markerset):</label>
58 <div class="col-sm-8" >
59 <div class="input-group">
60 <select class="form-control" id="markerset_select">
61 <option value="">Select a markerset</option>
66 <div class="form-group">
67 <label class="control-label col-sm-4"></label>
68 <div class="col-sm-8" >
69 <a href="/breeders/markers"><p>Need to create new markerset.</p></a>
79 <&| /page/info_section.mas, title=>'Step 3:'&>
80 <div class="row" id="search_form_3" >
81 <div class="col-sm-1">
83 <div class="col-sm-12 well">
85 <div class="col-sm-11">
86 <div class="form-horizontal">
87 <div class="form-group">
88 <label class="control-label col-sm-4"></label>
89 <div class="col-sm-8" >
90 <button class="btn btn-primary" id="search_accessions_using_markerset"><i class="glyphicon glyphicon-search"></i> Search Accessions</button>
101 <&| /page/info_section.mas, title => 'Search Results' , collapsible=>1, collapsed=>0 &>
103 <link rel="stylesheet" type="text/css" href="/documents/inc/datatables/jquery.dataTables.css">
105 <table id="genotype_search_results" width="100%" class="table table-hover table-striped">
112 jQuery(document).ready(function (){
114 var data_set = new CXGN.Dataset();
115 var lo = new CXGN.List();
117 // get_select_box('datasets', 'dataset_accessions', {"checkbox_name":"dataset_accessions_checkbox"});
118 jQuery('#stock_list_select').html(lo.listSelect('stock_list_select', ['accessions'], 'Select a list of accessions', undefined, undefined));
120 jQuery('#markerset_select').html(lo.listSelect('markerset_select', ['markers'], 'Select a markerset', undefined, undefined));
122 jQuery("#search_accessions_using_markerset").click(function(){
124 // var selected_datasets = [];
126 // jQuery('input[name="dataset_accessions_checkbox"]:checked').each(function() {
127 // selected_datasets.push(jQuery(this).val());
130 // if (selected_datasets.length < 1){
131 // alert('Please select a set of accessions!');
133 // } else if (selected_datasets.length > 1){
134 // alert('Please select only one set of accessions!');
137 // dataset_id = selected_datasets[0];
140 var stock_list_id = jQuery('#stock_list_select').val();
142 if (!stock_list_id) {
143 alert("Please choose a list of accessions");
147 var markerset_id = jQuery('#markerset_select').val();
150 alert("Please choose a markerset");
154 var table = jQuery('#genotype_search_results').DataTable({
156 'ajax': { 'url':'/ajax/search/search_stocks_using_markerset',
158 'stock_list_id': stock_list_id,
159 'markerset_id': markerset_id,
164 title: "Accession Name",
166 render: function(data, type, row){return "<a href='/stock/"+row.stock_id+"/view'>"+row.stock_name+"</a>";}
169 title: "Sample Name",
171 render: function(data, type, row){return "<a href='/stock/"+row.sample_id+"/view'>"+row.sample_name+"</a>";}
174 title: "Sample Type",
180 // render: function(data, type,row){
181 // var newFormat = data.split(",").join("         ");