1<table id="da-data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> 2 <thead> 3 <tr> 4 <th>Address</th> 5 <th>DNS</th> 6 <th class="nd_center-cell">Interface</th> 7 <th>Description</th> 8 <th>Prefix</th> 9 </tr> 10 </thead> 11</table> 12 13<script type="text/javascript"> 14$(document).ready(function() { 15 var table = $('#da-data-table').dataTable({ 16 "deferRender": true, 17 "data": [% results | none %], 18 "columns": [ 19 { 20 "data": 'alias', 21 "render": function(data, type, row, meta) { 22 return he.encode(data || ''); 23 } 24 }, { 25 "data": 'dns', 26 "render": function(data, type, row, meta) { 27 return he.encode(data || ''); 28 } 29 }, { 30 "data": 'port', 31 "type": 'portsort', 32 "render": function(data, type, row, meta) { 33 return type === 'display' ? 34 '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' : 35 he.encode(data || ''); 36 } 37 }, { 38 "data": 'device_port.name', 39 "render": function(data, type, row, meta) { 40 return he.encode(data || ''); 41 } 42 }, { 43 "data": 'subnet', 44 "render": function(data, type, row, meta) { 45 return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '&ip=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; 46 } 47 } 48 ], 49[% INCLUDE 'ajax/datatabledefaults.tt' -%] 50 }); 51}); 52</script> 53