Ajax pagination after sorting. fixes #309