6 <& /util/import_javascript.mas, classes => ['jquery.dataTables-buttons-min', 'jquery.iframe-post-form', 'jszip-min','buttons.bootstrap-min', 'buttons.html5-min', 'buttons.print-min'] &>
8 <div class="table-responsive" style="margin-top: 10px;">
9 <table id="location_table" class="table table-hover table-striped table-bordered" width="100%">
23 <!-- <caption class="well well-sm" style="caption-side: bottom;margin-top: 10px;"><center> Locations </center></caption> -->
28 <& /breeders_toolbox/upload_locations_dialogs.mas &>
30 <script defer="defer">
32 jQuery(document).ready(function() {
35 url: '/ajax/location/all',
36 beforeSend: function() {
37 // put working animation handling here
39 success: function(response) {
40 var export_message = window.location.href + ' location data.';
41 locationJSON = JSON.parse(response.data);
42 //console.log("Data is "+JSON.stringify(locationJSON, null, 2));
44 var table = jQuery('#location_table').DataTable( {
48 rowId: 'properties.Id',
50 { "data": "properties.Id" },
51 { "data": "properties.Name" },
52 { "data": "properties.Abbreviation" },
53 { "data": "properties.Code",
54 "render":function(data, type, full, meta){
55 return full.properties.Code + ' ' + full.properties.Country;
58 { "data": "properties.Program" },
59 { "data": "properties.Type" },
60 { "data": "properties.Altitude" },
61 { "data": "properties.Trials" },
63 buttons: [ 'copy','print'],
64 drawCallback: function( settings ) {
66 var name_data = api.column(1, { search:'applied' } ).data();
68 for (var i = 0; i < name_data.length; i++) { //extract names from data object
69 names.push(name_data[i]+'\n');
71 //console.log("Names are: "+JSON.stringify(names));
72 $('#location_names').html(names);
73 addToListMenu('locations_to_list_menu', 'location_names', {
79 var map = initialize_map('location_map', locationJSON, table);
82 error: function(response) {
83 alert("An error occurred");