Merge pull request #5243 from solgenomics/topic/observations_upload_catch_error
[sgn.git] / mason / brapiclient / maps.mas
blobb6f273dcced2675f92456bb2bcf48379944d441b
1 <%args>
2 </%args>
4 <div id="brapi_home_maps_div">
6     <h4>Genome Maps</h4>
7     <button class="btn btn-primary" name="brapi_home_maps_submit" id="brapi_home_maps_submit">Get Maps</button>
8     <br/><br/>
9     <div id="brapi_maps_data_result_div">
10     </div>
12 </div>
14 <script>
16 jQuery(document).ready(function() {
17     jQuery("#brapi_home_maps_submit").click(function() {
18         jQuery.ajax( {
19           'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/maps',
20           'method': 'GET',
21           'beforeSend': function() {
22             jQuery('#working_modal').modal('show');
23           },
24           'success': function(response) {
25             jQuery('#working_modal').modal('hide');
26             console.log(response);
27             brapi_create_paginated_table(response.result.data, response.metadata.pagination, 'brapi_maps_data_result_div', jQuery('#brapi_home_url_select').val()+'/brapi/v1/maps', undefined);
29           },
30           error: function(response) {
31             jQuery('#working_modal').modal('hide');
32             alert('An error occurred');
33           }
34         });
35     });
36 });
38 </script>