HubSpot / sortable

Drop-in script to make tables sortable
http://github.hubspot.com/sortable/docs/welcome
MIT License
1.33k stars 116 forks source link

added custom events for the start and end of the sort #13

Closed andersonk17474 closed 9 years ago

andersonk17474 commented 10 years ago

for very large tables (+1000 rows ), it is handy to have an event for the begin and end of the sort so that a processing indicator can be displayed while the table is sorted. Event('sortable:sorted') Event('sortable:start')

adamschwartz commented 9 years ago

Hey @andersonk17474, unfortunately, due to the way the event loop works, you won’t be able to get any paints in between these events unless we sort in a setTimeout or force a repaint between these events in another way. In addition though, we feel that Sortable is really meant to be used with relatively small tables, as it is a very lightweight library. There are no shortage of other libraries out there for handling large tables (datatables is great, for example), so my recommendation would be to look into one of those.

@derekmd needed an end event for another reason though (https://github.com/HubSpot/sortable/pull/25), so we did end up implementing this in cab1613b721e7a7512417ded8fb62d163c647777. Thanks!