1<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> 2 <thead> 3 <tr> 4 <th class="nd_center-cell">Device</th> 5 <th class="nd_center-cell">Address</th> 6 <th class="nd_center-cell">Contact</th> 7 <th class="nd_center-cell">Location</th> 8 </tr> 9 </thead> 10</table> 11 12<script type="text/javascript"> 13$(document).ready(function() { 14 var table = $('#data-table').dataTable({ 15 "deferRender": true, 16 "data": [% results | none %], 17 "columns": [{ 18 "data": 'ip', 19 "render": function(data, type, row, meta) { 20 return '<a href="[% search_device | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.name || row.ip) + '</a>'; 21 } 22 }, { 23 "data": 'alias', 24 "render": function(data, type, row, meta) { 25 return he.encode(data || ''); 26 } 27 }, { 28 "data": 'contact', 29 "render": function(data, type, row, meta) { 30 return he.encode(data || ''); 31 } 32 }, { 33 "data": 'location', 34 "render": function(data, type, row, meta) { 35 return he.encode(data || ''); 36 } 37 } 38 ], 39[% INCLUDE 'ajax/datatabledefaults.tt' -%] 40 }); 41});</script> 42