Merge pull request #5243 from solgenomics/topic/observations_upload_catch_error
[sgn.git] / mason / brapiclient / markerprofile_search.mas
blobcd9fac8130cc1768cd14a3f22a2a5525faa9f070
1 <%args>
2 </%args>
4 <& /util/import_javascript.mas, classes => [ 'brapi.Table' ] &>
6 <h4>MarkerProfile Search</h4>
8 <div id="brapi_markerprofile_search_home_div">
10 <input name="brapi_markerprofile_search_germplasmDbId" id="brapi_markerprofile_search_germplasmDbId" class="form-control" type="text" placeholder="GermplasmDbId" />
11 <input name="brapi_markerprofile_search_studyDbId" id="brapi_markerprofile_search_studyDbId" class="form-control" type="text" placeholder="StudyDbId" />
12 <input name="brapi_markerprofile_search_methodDbId" id="brapi_markerprofile_search_methodDbId" class="form-control" type="text" placeholder="MethodDbId" />
13 <button class="btn btn-primary" name="brapi_markerprofile_search_submit" id="brapi_markerprofile_search_submit">Search</button>
15 <br/><br/>
17 <div id="brapi_markerprofile_search_result_div">
19 </div>
21 </div>
23 <script>
25 jQuery(document).ready(function() {
26     jQuery("#brapi_markerprofile_search_submit").click(function() {
27         jQuery.ajax( {
28           'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/markerprofiles?germplasmDbId='+jQuery("#brapi_markerprofile_search_germplasmDbId").val()+'&studyDbId='+jQuery("#brapi_markerprofile_search_studyDbId").val()+'&methodDbId='+jQuery("#brapi_markerprofile_search_methodDbId").val(),
29           'method': 'GET',
30           'success': function(response) {
31             console.log(response);
32             brapi_create_paginated_table(response.result.data, response.metadata.pagination, 'brapi_markerprofile_search_result_div', jQuery('#brapi_home_url_select').val()+'/brapi/v1/markerprofiles', undefined);
34           },
35           error: function(response) {
36             alert('An error occurred');
37           }
38         });
39     });
40 });
43 </script>