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

@@ -4,6 +4,7 @@
* DNS Mismatch report incorrectly trimmed domain_suffix * DNS Mismatch report incorrectly trimmed domain_suffix
* Fake one device aliases entry for devices not providing ip_index * Fake one device aliases entry for devices not providing ip_index
* DataTables render function should check for type
2.028006 - 2014-07-21 2.028006 - 2014-07-21

View File

@@ -25,12 +25,16 @@ $(document).ready(function() {
"data": 'ip', "data": 'ip',
"render": function(data, type, row, meta) { "render": function(data, type, row, meta) {
var cell_str = he.encode(data); var cell_str = he.encode(data);
if (type == 'display') {
if (row.time_last && row.node) { 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>'; 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) { else if (row.time_last) {
cell_str = '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>'; cell_str = '<a href="[% search_device %]&q=' + encodeURIComponent(data) + '">' + he.encode(data) + '</a>';
} }
}
return cell_str; return cell_str;
} }
}, { }, {