DataTables render function should check for type

This commit is contained in:
Oliver Gorwits
2014-07-21 21:48:52 +00:00
parent 7241db7a23
commit c1846103fe
2 changed files with 10 additions and 5 deletions

View File

@@ -25,11 +25,15 @@ $(document).ready(function() {
"data": 'ip',
"render": function(data, type, row, meta) {
var cell_str = he.encode(data);
if (row.time_last && row.node) {
cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data) + (row.active ? '' : '&archived=on') + '">' + he.encode(data) + (row.active ? '' : '&nbsp;<i class="icon-book text-warning"></i>&nbsp;') + '</a>';
}
else if (row.time_last) {
cell_str = '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
if (type == 'display') {
if (row.time_last && row.node) {
cell_str = '<a href="[% search_node %]&q=' + encodeURIComponent(data)
+ (row.active ? '' : '&archived=on') + '">' + he.encode(data)
+ (row.active ? '' : '&nbsp;<i class="icon-book text-warning"></i>&nbsp;') + '</a>';
}
else if (row.time_last) {
cell_str = '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
}
}
return cell_str;
}