The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<table id="data-table" class="table table-striped table-bordered" width="100%" cellspacing="0">
  <thead>
    <tr>
      <th class="nd_center-cell">Location</th>
      <th class="nd_center-cell">Device</th>
      <th class="nd_center-cell">System Name</th>
      <th class="nd_center-cell">Vendor</th>
      <th class="nd_center-cell">Model</th>
    </tr>
  </thead>
</table>

<script type="text/javascript">
$(document).ready(function() {
    var table = $('#data-table').dataTable({
        "processing": true,
        "stateSave": true,
        "pageLength": [% settings.table_pagesize %],
        "language": {
          "search": 'Filter records: '
        },
        "deferRender": true,
        "order": [[ 0, "asc" ], [2, "asc"], [ 3, "asc" ], [4, "asc"]],
        "data": [% results %],
        "columns": [
           {
                "data": 'location',
                "render": function(data, type, row, meta) {
                  if (data) {
                    return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&location=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';

                  } else {
                    return '[Not Set]';
                  }
                }
            }, {
                "data": 'ip',
                "render": function(data, type, row, meta) {
                    return '<a href="[% uri_for('/device') %]?q=' + encodeURIComponent(data) + '">' + he.encode(row.dns || row.ip) + '</a>';
                }
            }, {
                "data": 'name',
                "render": function(data, type, row, meta) {
                    return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
                }
            }, {
                "data": 'vendor',
                "render": function(data, type, row, meta) {
                    return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
                }
            }, {
                "data": 'model',
                "render": function(data, type, row, meta) {
                    return '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '&model=' + encodeURIComponent(data) + '">' + he.encode(data || '') + '</a>';
                }
            }
        ]
    });

});
</script>