graphical filtering of accession search
[sgn.git] / mason / brapiclient / trials_detail.mas
blob38729f8c3e23b0c220c4d077f4a79611586dcd45
1 <%args>
2 </%args>
4 <div id="brapi_home_trial_details_div">
6     <h4>Trial Detail</h4>
7     <input name="brapi_home_trials_id" id="brapi_home_trials_id" class="form-control" type="text" placeholder="TrialDbId e.g. 145" value="145"/>
8     <button class="btn btn-primary" name="brapi_home_trial_detail_submit" id="brapi_home_trial_detail_submit">Get Trial Details</button>
9     <br/><br/>
10     <div id="brapi_trials_details_div">
11     </div>
13 </div>
15 <script>
17 jQuery(document).ready(function() {
18     jQuery("#brapi_home_trial_detail_submit").click(function() {
20         jQuery.ajax( {
21           'url':  jQuery('#brapi_home_url_select').val()+'/brapi/v1/trials/'+jQuery('#brapi_home_trials_id').val(),
22           'method': 'GET',
23           'success': function(response) {
24             console.log(response);
25             brapi_create_table(response.result, 'brapi_trials_details_div', undefined);
27           },
28           error: function(response) {
29             alert('An error occurred');
30           }
31         });
32     });
33 });
35 </script>