Integers are sorted by first integer, not the entire integer value?
Integers are sorted by first integer, not the entire integer value?

Upon initial load, my table is displaying, I assume, in order of the primary key value however they are being displayed as follows:
1
2
27
29
3
31
4...
It's only ordering using the first integer, not the entire integer value. Is this a bug?
NJ
This discussion has been closed.
Answers
I've tried recreating this here:
http://live.datatables.net/tapadego/1/edit
...but of course the above works, yet my table is set up exactly the same way albeit my values are dynamic.
Hi @NJWebDesign ,
When the table loads, the code tries to determine the data type. If it's sorting like that, it thinks the column is a string, so maybe there's a value in there that's non-numeric. You can force the type by setting
columns.type
tonum
,Cheers,
Colin
Ah, yes, there's a NULL value for some records.
Where do I edit the columns.type option? Thank you.
Either in the
columnDefs
, orcolumns
.C
Ah. That'll be me hitting a brick wall then!
Where/how do you change these options? Are they values in a JS file that need changed?
Sorry, I am completely new to stuff like this.
NJ
It's when you initialise the table. This example here is setting visibility, and you can see the declarations there.