Open peter-walter opened 3 years ago
On further investigation
eg
var data = [
{ name: 'D', count: 0 },
{ name: 'A', count: 16 },
{ name: 'B', count: 151 },
{ name: 'C', count: 11 },
{ name: 'F', count: 44 },
{ name: 'E', count: 5 }
];
will throw the error in the console.
If you engineer the list to have a non-zero (positive or negative) at the top of the column, then the sort works fine.
i had to hack a bit as my knowledge of webpack and node is really limited and i don't understand how to get a maxified version of the table-sortable.min.js ... but i managed to get something readable and i added a NaturalSort function that fix the sorting of items in the list. Please check the enclosed modified table-sortable-naturalSort-max.js table-sortable-naturalSort-max.zip
This code is under WTFPL.
Many thanks @ravid7000 for this great jQuery plugin that is perfect for my inventory project btw.
I have the following simplified configuration
When sorting against the 'count' column you will see the numbers 151 and 44 are incorrectly sorted.
![image](https://user-images.githubusercontent.com/13538087/106769937-680e4e80-6635-11eb-839a-6b850561d380.png)
I have tried removing the quotes around the numbers, however the number zero then presents a problem and fires an exception:![image](https://user-images.githubusercontent.com/13538087/106770744-292cc880-6636-11eb-82ad-8c313936131e.png)
Any help gratefully received.