Hide Tooltip if Value is Empty

Hide Tooltip if Value is Empty

zgoforthzgoforth 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

Sign In or Register to comment.