 
 PRIVATE>
 
-: (selected-rows) ( table -- {row} )
-    [ selected-indices>> keys natural-sort ] keep
-    '[ _ nth-row [ 1array ] [ drop { } ] if ] map concat ;
-
-: selected-rows ( table -- {value} )
-    [ (selected-rows) ] [ renderer>> ] bi '[ _ row-value ] map ;
+: (selected-rows) ( table -- assoc )
+    [ selected-indices>> ] keep
+    '[ _ nth-row drop ] assoc-map ;
+
+: selected-rows ( table -- assoc )
+    [ selected-indices>> ] [ ] [ renderer>> ] tri
+    '[ _ nth-row drop _ row-value ] assoc-map ;
 
 : (selected-row) ( table -- value/f ? ) (selected-rows) multiple>single ;
 

M: table model-changed
    nip dup update-selected-indices {
        [ >>selected-indices f >>mouse-index drop ]
        [ [ f ] [ first ] if-empty show-row-summary ]
        [ drop update-selected ]
        [ drop relayout ]
    } 2cleave ;

        [ drop { 0 } unique ]
    } 1&& ;

: update-selected-indices ( table -- set )
    {
        [ (update-selected-indices) ]
        [ initial-selected-indices ]
