4 <div id="brapi_home_study_germplasm_detail_div">
6 <h4>Study Germplasm</h4>
7 <input name="brapi_home_studygermplasmdbid" id="brapi_home_studygermplasmdbid" class="form-control" type="text" placeholder="StudyDbId e.g. 139" value="139"/>
8 <button class="btn btn-primary" name="brapi_home_studygermplasmdbid_submit" id="brapi_home_studygermplasmdbid_submit">Get Germplasm</button>
10 <div id="brapi_studygermplasm_detail_result_div">
12 <div id="brapi_studygermplasm_data_result_div">
19 jQuery(document).ready(function() {
20 jQuery("#brapi_home_studygermplasmdbid_submit").click(function() {
22 'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/studies/'+jQuery('#brapi_home_studygermplasmdbid').val()+'/germplasm',
24 'beforeSend': function(){
25 jQuery('#working_modal').modal('show');
27 'success': function(response) {
28 jQuery('#working_modal').modal('hide');
29 console.log(response);
30 var html = '<table class="table table-bordered"><thead><tr><th>StudyDbId</th><th>TrialName</th></tr></thead><tbody><tr><td>'+response.result.studyDbId+'</td><td>'+response.result.studyName+'</td></tr></tbody></table>';
31 jQuery('#brapi_studygermplasm_detail_result_div').empty().html(html);
32 brapi_create_paginated_table(response.result.data, response.metadata.pagination, 'brapi_studygermplasm_data_result_div', jQuery('#brapi_home_url_select').val()+'/brapi/v1/studies/'+jQuery('#brapi_home_studygermplasmdbid').val()+'/germplasm', undefined);
35 error: function(response) {
36 jQuery('#working_modal').modal('hide');
37 alert('An error occurred');