v input view
Sortmap returns a map which describes in which order the rows need to be remapped to become sorted.
set v [view A def {a d b c}] view $v sortmap 0 2 3 1
0 2 3 1