matanhershberg/animated_table_sorter — pull request #1 by orczhou (2013-11-25 18:50:41+00:00)
Title: Re-sort table data if __tsort_rebuild is set

Why?
I'm trying to use tsort to implement a real-time monitor system. Ajax is used to update data in the table. After updated, the old version tsort would not re-sort table.

How?
A new variable "\__tsort_rebuild" is added to fix this. Once "__tsort_rebuild" is defined, ervery time you click the resort button(<th>...</th>), tsort will try resort data with function "getTableData".

Code Sample

```javascript
var __tsort_rebuild = 1;
var __tsort_direction = "descending";

setInterval("autosort()",3000);

function autosort(){
$.ajax(
{
.......
error: function(){
....
},
success: function(realdata){
... update data in table ...
// resort
}
}
);
$("#sorttable").find('#th_id').first().trigger('click');
}
```

Demo: [MySQL Realtime Status](http://www.orczhou.com/tsort/)