fixed the sortBy method to renumber the view's row id numbers
trying to recommit 77f3b606028034e4d035bf920562b29d1feb01ba
hum
added a little fix to the loop modifying the row id's and encapsulated it in a method