1<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> 2 <thead> 3 <tr> 4 <th>VLAN ID</th> 5 <th>VLAN Name</th> 6 </tr> 7 </thead> 8</table> 9 10<script type="text/javascript"> 11$(document).ready(function() { 12 var table = $('#data-table').dataTable({ 13 "deferRender": true, 14 "data": [% results | none %], 15 "columns": [ 16 { 17 "data": 'vlan', 18 "render": function(data, type, row, meta) { 19 return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.ip) + '&f=' + encodeURIComponent(data) + '">' + data + '</a>'; 20 } 21 }, { 22 "data": 'description', 23 "render": function(data, type, row, meta) { 24 return '<a href="[% uri_for('/search') | none %]?tab=vlan&q=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>'; 25 } 26 } 27 ], 28[% INCLUDE 'ajax/datatabledefaults.tt' -%] 29 }); 30}); 31</script> 32