add more elements to interface with analysis store code.
[sgn.git] / mason / brapiclient / maps_detail.mas
blob55e5060cb2c5adae540c01a6a925f550a5ddc5ff
1 <%args>
2 </%args>
4 <div id="brapi_home_maps_detail_div">
6     <h4>Genome Map Details</h4>
7     <input name="brapi_home_mapsdbid" id="brapi_home_mapsdbid" class="form-control" type="text" placeholder="MapsDbId e.g. 1" value="1"/>
8     <input name="brapi_home_maps_linkagegroupids" id="brapi_home_maps_linkagegroupids" class="form-control" type="text" placeholder="LinkageGroupIds e.g. S5,S13" value="S5,S13"/>
9     <input name="brapi_home_maps_min" id="brapi_home_maps_min" class="form-control" type="text" placeholder="Minimum Position e.g. 10000" value="10000"/>
10     <input name="brapi_home_maps_max" id="brapi_home_maps_max" class="form-control" type="text" placeholder="Maximum Position e.g. 200000" value="200000"/>
11     <button class="btn btn-primary" name="brapi_home_mapsdbid_submit" id="brapi_home_mapsdbid_submit">Get Map Details</button>
12     <br/><br/>
13     <div id="brapi_maps_detail_result_div">
14     </div>
15     <div id="brapi_maps_info_result_div">
16     </div>
17     <div id="brapi_maps_positions_result_div">
18     </div>
20 </div>
22 <script>
24 jQuery(document).ready(function() {
25     jQuery("#brapi_home_mapsdbid_submit").click(function() {
26         jQuery.ajax( {
27           'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/maps/'+jQuery('#brapi_home_mapsdbid').val(),
28           'method': 'GET',
29           'success': function(response) {
30             console.log(response);
31             brapi_create_table(response.result, 'brapi_maps_detail_result_div', undefined);
32             brapi_create_paginated_table(response.result.linkageGroups, response.metadata.pagination, 'brapi_maps_info_result_div', '/brapi/v1/maps/'+jQuery('#brapi_home_mapsdbid').val(), undefined);
33           },
34           error: function(response) {
35             alert('An error occurred');
36           }
37         });
39         jQuery.ajax( {
40           'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/maps/'+jQuery('#brapi_home_mapsdbid').val()+'/positions?linkageGroupIdList='+jQuery('#brapi_home_maps_linkagegroupids').val()+'&min='+jQuery('#brapi_home_maps_min').val()+'&max='+jQuery('#brapi_home_maps_max').val(),
41           'method': 'GET',
42           'success': function(response) {
43             console.log(response);
44             brapi_create_paginated_table(response.result.data, response.metadata.pagination, 'brapi_maps_positions_result_div', jQuery('#brapi_home_url_select').val()+'/brapi/v1/maps/'+jQuery('#brapi_home_mapsdbid').val()+'/positions', undefined);
45           },
46           error: function(response) {
47             alert('An error occurred');
48           }
49         });
51     });
52 });
54 </script>