1<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> 2 <thead> 3 <tr> 4 <th>Device</th> 5 <th>Port</th> 6 <th>Port Description</th> 7 <th>Admin Status</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 "order": [[ 0, "asc" ], [1, "asc"]], 17 "columns": [ 18 { 19 "data": 'ip', 20 "render": function(data, type, row, meta) { 21 return he.encode(row.dns || row.name || row.ip); 22 } 23 }, { 24 "data": 'port', 25 "type": 'portsort', 26 "render": function(data, type, row, meta) { 27 return type === 'display' ? 28 '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '&c_nodes=on">' + he.encode(data || '') + '</a>' : 29 he.encode(data || ''); 30 } 31 }, { 32 "data": 'description', 33 "render": function(data, type, row, meta) { 34 return he.encode(data || ''); 35 } 36 }, { 37 "data": 'up_admin', 38 "orderable": false, 39 "searchable": false, 40 "render": function(data, type, row, meta) { 41 return he.encode(data || ''); 42 } 43 } 44 ], 45 "data": [% results | none %], 46[% INCLUDE 'ajax/datatabledefaults.tt' -%] 47 }); 48}); 49</script> 50