js sorting of events tables