Null value handling.

Null value handling.

andrew_mandrew_m Posts: 31Questions: 0Answers: 0
edited March 2009 in General
Hi.

I returned null value for certain cell in aaData array, and i got "sData is null" exception.

Is it correct behavior?

Replies

  • allanallan Posts: 63,602Questions: 1Answers: 10,486 Site admin
    Yes this is correct behaviour. If you change the type of a variable (it will have been a string or a number before), then DataTables will get a little upset as you can see :-)

    Why would you want to set it to null? If you want to empty the cell, just set it to be a blank string. That way the filtering extra can still parse the data.

    Allan
  • andrew_mandrew_m Posts: 31Questions: 0Answers: 0
    Well, null value came from null foreign key filed, which allows nulls, so there are may be nulls, but may be valid key values. It actually not a big problem for us, we can replace nulls with something without sense, for example -1 for null key values, or string.empty for null strings.

    Thanks for support Allan.
This discussion has been closed.