Displaying null int as empty " "
Displaying null int as empty " "
Newinthezone
Posts: 22Questions: 0Answers: 0
Hi
I have this issue where I am using server side processing. What is happening that if I have a integer type of column(in the sql) having nulls values , they are displayed as 0 in the data tables even though I check for null values and I dont assign them any value.
So by default ,they seem to be displaying 0. But I remember when I was using client side processing ,int columns with null values would be displayed as " "(empty) .
If I use string datatype and convert the int to string and display null int as empty string , that solves one issue but when it comes to sorting strings with numbers, it sorts in an unusual way. That is the correct ascending order for sort for numbers should be [0,1,2,3,4,5.. ] but it displays ascending order as [1,10,100,1000...] in case of string.
So how could I tell datatables to display null ints as " " or how could I sort strings with numbers in the the correct numerical way.
I have this issue where I am using server side processing. What is happening that if I have a integer type of column(in the sql) having nulls values , they are displayed as 0 in the data tables even though I check for null values and I dont assign them any value.
So by default ,they seem to be displaying 0. But I remember when I was using client side processing ,int columns with null values would be displayed as " "(empty) .
If I use string datatype and convert the int to string and display null int as empty string , that solves one issue but when it comes to sorting strings with numbers, it sorts in an unusual way. That is the correct ascending order for sort for numbers should be [0,1,2,3,4,5.. ] but it displays ascending order as [1,10,100,1000...] in case of string.
So how could I tell datatables to display null ints as " " or how could I sort strings with numbers in the the correct numerical way.
This discussion has been closed.
Replies
Allan
Thanks for your reply , i got it to work . Server side is wonderful . I remember I couldnt get it to work earlier. But now its all cool