Unable to execute if conditions using REST
Unable to execute if conditions using REST
beginner_2018
Posts: 46Questions: 19Answers: 0
Dear All,
I am accessing the data from SharePoint list items , And I had written the if condition to set the value if it is null.
But I continuously get the error.
Can any one please do let me know what's wrong in it
{
"mData": "StagePlan",
render: function (data, type, row, meta ) {
if(data=="[object Object]" || data=="null")
{
return "No Data ";
}
else
{
return data;
}
}
}
This discussion has been closed.
Answers
We'd really need a link to a page showing the issue so we can help to debug it.
Allan
Hi @beginner_2018 ,
data=="[object Object]"
looks odd, and I'm not sure it's doing what you want it to do, but I'd be surprised if that's causing the error.However, if you comment out all that
columns.render
code and just havereturn data
, do you still see the error?Cheers,
Colin