Hide Tooltip if Value is Empty
Hide Tooltip if Value is Empty
zgoforth
Posts: 493Questions: 98Answers: 2
Link to test case: https://jsfiddle.net/BeerusDev/n06greay/40/
Hello, I am using a tooltip to hover over rows that may have important notes over them. The thing is that not all rows will have notes accompanying them. I have tried the following but I can't seem to get it to work:
columnDefs: [{
"targets": "_all",
"render": function(data, type, full, meta) {
if(data != null && data != undefined){
return type === 'display' ? '<div title="Notes: ' + full.Notes + '">' + data : data;
}
else {
return '';
}
}
}
],
I also tried replacing data with full.Notes
and that hides the information from the row itself, not the tooltip.
This question has an accepted answers - jump to answer
Answers
You will need to refactor your code with an if statement instead of the on liner in line 5. Pseudo code:
Kevin
Receiving a "unknown parameter" https://jsfiddle.net/BeerusDev/n06greay/48/
Sorry I linked the wrong fiddle: https://jsfiddle.net/BeerusDev/n06greay/53/