Table sorting issue

Table sorting issue

mrseefeldmrseefeld Posts: 5Questions: 0Answers: 0
edited October 2011 in General
I want to say thanks very much for the creator of the plugin. It is very useful.

I have a question regarding sorting.
It is return a list of address for some searches in the following format.

1 Main Street
12 Main Street
13 Main Street
14 Main Street
...
2 Main Street
3 Main Street
4 Main Street
5 Main Street
..

As you can see the sorting is not what I would expected. Will return all numbers starting with `1 eg, 11, 111, 1111` before `2`.

Is there any option to make it sort properly? Or maybe there is a way to disable the sorting on first initiate(display the data as it is coming form db)?

Any suggestions much appreciated.
Thanks, Peter

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Hi Peter,

    > I want to say thanks very much for the creator of the plugin. It is very useful.

    My pleasure - great to hear that you are finding it useful!

    For your question - what you want to do is use the natural sorting plug-in: http://datatables.net/plug-ins/sorting#natrual . That will "chunk" your data to have it sorted as you would expect.

    Allan
This discussion has been closed.