Add sorting through ranks in items template and jQuery UI