message dialog and js
[sgn.git] / mason / brapiclient / traits_detail.mas
blob5bf9096d2ac93751c3d5091cb4c6d12deffd66c0
1 <%args>
2 </%args>
4 <div id="brapi_home_trait_detail_div">
6     <h4>Germplasm Details</h4>
7     <input name="brapi_home_traitdbid" id="brapi_home_traitdbid" class="form-control" type="text" placeholder="TraitDbId e.g. 70741" value="70741"/>
8     <button class="btn btn-primary" name="brapi_home_traitdbid_submit" id="brapi_home_traitdbid_submit">Get Trait Details</button>
9     <br/><br/>
10     <div id="brapi_trait_detail_result_div">
11     </div>
13 </div>
15 <script>
17 jQuery(document).ready(function() {
18     jQuery("#brapi_home_traitdbid_submit").click(function() {
19         jQuery.ajax( {
20           'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/traits/'+jQuery('#brapi_home_traitdbid').val(),
21           'method': 'GET',
22           'success': function(response) {
23             console.log(response);
24             brapi_create_table(response.result, 'brapi_trait_detail_result_div', undefined);
26           },
27           error: function(response) {
28             alert('An error occurred');
29           }
30         });
31     });
32 });
34 </script>