How to set default value for null strings
How to set default value for null strings
texqas
Posts: 6Questions: 3Answers: 0
So, I'm using an invisible column as a tool tip in another column. The invisible column has lots of null values and I want to display empty or nothing if the value is null.
Here is what I have.
"render": function (data, type, row, meta) {
id (type=== 'display') {
data = 'blablabla... + row[myInvisiblecolumn] + ...
}
return data;
}
How can I set null to empty? in redner function while concatenating strings?
Thanks.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Something like this standard Javascript notation maybe?
data = 'blablabla... + row[myInvisiblecolumn] === null ? '' : row[myInvisiblecolumn] + ...
Kevin
Thanks. You forgot the parenthesis though.