Here is a short summary of some of the major changes:
– Tables with `data-sortable` attribute are automatically initialized.
– The sort arrows are made with CSS-border triangles instead of special characters.
– The sort arrows are always present but hidden for non-sorted columns so that columns don't resize when sorting.
– `sorttable_`-prefixed class names are now `data-` attributes, so they are valid HTML5.
– The library doesn't attempt to recognize date formats. Instead, it recommends you add `data-value="#{ timeInMillis }"` to your <td> containing a human-readable date string.
I'm sure there are more that I can't think of at the moment, but that's a decent list.
- Webdings: https://github.com/HubSpot/sortable/blob/37894eb51bda9f0e438...
- Using class names, rather than data attributes, for everything: https://github.com/HubSpot/sortable/blob/37894eb51bda9f0e438...
- Hardcoded date formats which would make localization tough: https://github.com/HubSpot/sortable/blob/37894eb51bda9f0e438...
- Sorting in JavaScript (not using Array.prototype.sort): https://github.com/HubSpot/sortable/blob/37894eb51bda9f0e438...
- Overriding event bindings in a destructive manner: https://github.com/HubSpot/sortable/blob/37894eb51bda9f0e438...
Not to mention stuff I just find objectionable:
- Useless comments: https://github.com/HubSpot/sortable/blob/37894eb51bda9f0e438...
- Mistabbing: https://github.com/HubSpot/sortable/blob/37894eb51bda9f0e438...
It also looks like this one is 1/3 the length.
To be fair though, the original was written seven years ago, and still works, so it's not really fair to criticize it by modern standards. Suffice it to say that it was time for something new.
How does yours differ from that one in terms of features/capabilities?
Is it a rewrite with more modern techniques?