Sort bug when table has more than 9 columns
Sort bug when table has more than 9 columns
![rwasef1830](https://secure.gravatar.com/avatar/5822f9b1e0253543b4e2c01d9c02ac5f/?default=https%3A%2F%2Fvanillicon.com%2F5822f9b1e0253543b4e2c01d9c02ac5f_200.png&rating=g&size=120)
Hello,
There's a bug in sorting in Datatables 2+, when there's more than 9 columns (eg: 10) and you ask for initial sort of column index 10. Column with index 1 mistakenly is matched.
This is due to this part:
As a solution, should prepend , and append at the end , even if it's a single index, and do indexOf with "," + index + "," to ensure partial numbers are not matched.
Will setup a test case and link it soon.
Replies
Ok i just noticed it was fixed by:
https://github.com/DataTables/DataTablesSrc/commit/c23d8f509f73be4e48027d95fa6026bb6438d958
Thank you guess I need to wait for a release.
I'll drop 2.0.3 next week![:) :)](https://datatables.net/forums/resources/emoji/smile.png)
Allan
Great!
As usual, thank you @allan :-)
That was good timing - 2.0.3 is available now![:) :)](https://datatables.net/forums/resources/emoji/smile.png)
Release notes here. The one of interest in this thread is the second point in the "fixes".
Allan