Custom type sort is incorrect in Chrome with over 10 items

Custom type sort is incorrect in Chrome with over 10 items

paulhildebrandtpaulhildebrandt Posts: 2Questions: 1Answers: 0

It took me a while to track it down but here is what I think is happening.

If I create a custom type that has it's own sort AND there are over 10 items AND you are using Chrome the sort result is in the wrong order.

https://jsfiddle.net/paulhildebrandt/Lzb1ot8o/2/

Is this a bug or have I overlooked something simple?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,184Questions: 26Answers: 4,925
    Answer ✓

    Two things you need to do:

    1. The sort function needs to return -1, 0 or 1. The ordering plugin doc shows this.
    2. Move the sorting functions above the table init code. Otherwise the initial order won't use the functions.

    Here is the updated example:
    https://jsfiddle.net/cv8jnaa2/8/

    Kevin

  • paulhildebrandtpaulhildebrandt Posts: 2Questions: 1Answers: 0

    Thanks! If you had a tip jar I would put something in it.

This discussion has been closed.