I am working with editable grid in my application. I have columns which vary from a string datatype to number, I am facing some problem While validating for emptiness of a grid cells. As easy as it sounds, it is getting confusing and frustrating.
This is what I am using to check if the field is empty:
if (value == "") {
//do work here
}
This works fine for columns with string
datatype, but when a value of datatype number
is there, it fails to check it as value contains NaN
at that moment. I have tried most methods mentioned in this answer, but in vain. Secondly, I also want to avoid nested or unnecessary ifs in this case..