fordth / jinqJs

jinqJs provides a simple way to perform SQL like queries on javaScript arrays, collections and web services using LINQ expressions.
Other
93 stars 29 forks source link

OrderBy has unexpected behaviour #8

Closed datenwort closed 8 years ago

datenwort commented 8 years ago

Hi,

I tried to use the jinqJs library, but was confused why sorting was not done correctly. It seems that sorting based on string sorting, but if I use a number column for the orderBy criteria it failed.

Here is a jsfiddle example

fordth commented 8 years ago

Yes you are correct, it does a string base sort by default as described here: https://jinqjs.readme.io/docs/orderby

You can do a number based sort as you expected too, here is an update to your fiddle: https://jsfiddle.net/tford/8ue2eg49/

Let me know if you have anymore questions.

Thanks, Tom

datenwort commented 8 years ago

Thx. Have changed the items and now it is running as expected