Sorting in views. Trying out json handling with js