bgultekin / laravel4-datatables-package

Server-side handler of DataTables Jquery Plugin for Laravel 4
267 stars 108 forks source link

Ordering by numeric value doesn't work #198

Closed adriandmitroca closed 9 years ago

adriandmitroca commented 9 years ago

I've tried to order column by numeric values (for example by ID) but DataTables is treating row values as strings irrespective of custom parsing to float (I've tried to extend sorting by custom functions) or setting sType to numeric but without any success.

It looks to server-side issue because td values are clean numbers without commas or any HTML code in it.

So the result that I get is for example: 10 11 100 20 21 22

and so...

EDIT Fixed - data type in database also HAS to be numeric.

MarkVaughn commented 9 years ago

ay, you can probably use CAST( column AS signed) or similar if you can't change the type of the column