@@ -6,6 +6,7 @@ import Html exposing (Html, Attribute, program, div, a, h1, span, button, table,
66import Html.Attributes exposing (id , class , classList , attribute , type_ , href )
77import Html.Events exposing (onClick )
88import Html.Keyed
9+ import Html.Lazy
910import String
1011import Random.Pcg exposing (Seed , Generator )
1112
@@ -115,10 +116,14 @@ btnPrimaryBlock ( buttonId, labelText, msg ) =
115116 ]
116117
117118
118- rowView : Int -> Row -> ( String , Html Msg )
119- rowView index { id, label, selected } =
120- ( toString id
121- , tr
119+ viewKeyedRow : Int -> Row -> ( String , Html Msg )
120+ viewKeyedRow index row =
121+ ( toString row. id, Html . Lazy . lazy2 viewRow index row )
122+
123+
124+ viewRow : Int -> Row -> Html Msg
125+ viewRow index { id, label, selected } =
126+ tr
122127 [ classList [ ( " danger" , selected ) ] ]
123128 [ td [ class " col-md-1" ] [ text ( toString id) ]
124129 , td
@@ -144,7 +149,6 @@ rowView index { id, label, selected } =
144149 ]
145150 , td [ class " col-md-6" ] []
146151 ]
147- )
148152
149153
150154view : Model -> Html Msg
@@ -170,7 +174,7 @@ view model =
170174 [ class " table table-hover table-striped test-data" ]
171175 [ tbody
172176 []
173- ( List . indexedMap rowView model. rows)
177+ ( List . indexedMap viewKeyedRow model. rows)
174178 ]
175179 , span
176180 [ class " preloadicon glyphicon glyphicon-remove"
0 commit comments