Sort by default by filterfield
Fix a JS error when a small number of records are loaded, by
looping through the actual number of returned results, not how many
should be on each page.