<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0"> <thead> <tr> <th>Left Device</th> <th>Left Port</th> <th>Only Left VLANs</th> <th>Right Device</th> <th>Right Port</th> <th>Only Right VLANs</th> </tr> </thead> </table> <script type="text/javascript"> $(document).ready(function() { var table = $('#data-table').dataTable({ "deferRender": true, "data": [% results | none %], "columns": [ { "data": 'left_ip', "render": function(data, type, row, meta) { return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.left_dns || data || '') + '</a>'; } }, { "data": 'left_port', "type": 'portsort', "render": function(data, type, row, meta) { return type === 'display' ? '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.left_ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' + '<br />' + he.encode(row.left_port_descr || '') : he.encode(data || ''); } }, { "data": 'only_left_vlans' }, { "data": 'right_ip', "render": function(data, type, row, meta) { return '<a href="[% device_ports | none %]&q=' + encodeURIComponent(data) + '">' + he.encode(row.right_dns || data || '') + '</a>'; } }, { "data": 'right_port', "type": 'portsort', "render": function(data, type, row, meta) { return type === 'display' ? '<a href="[% device_ports | none %]&q=' + encodeURIComponent(row.right_ip) + '&f=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>' + '<br />' + he.encode(row.right_port_descr || '') : he.encode(data || ''); } }, { "data": 'only_right_vlans' } ], [% INCLUDE 'ajax/datatabledefaults.tt' -%] }); }); </script>