Closed awb99 closed 6 months ago
def columns [{:path [:Animal :Name] :header "Name" :key :Name} ; convention - use field name for reagent key {:path [:Animal :Colour] :header "Colour" :key :Colour} {:path [:Animal :Skin] :header "Skin Type" :key :Skin} {:path [:Animal :Weight] :header "Weight" :format #(format-number %) :attrs (fn [data] {:style {:text-align "right" :display "block"}}) :key :Weight} {:path [:Animal :Age] :header "Age" :attrs (fn [data] {:style {:text-align "right" :display "block"}}) :key :Age} {:path [:Animal :Hostile] :header "Hostile?" :format #(if % "Stay Away!" "OK to stroke") :key :Hostile}])
[rt/reagent-table table-data {:table {:class "table table-hover table-striped table-bordered table-transition"
:style {:border-spacing 0
:border-collapse "separate"}}
:table-container {:style {:border "1px solid green"}}
:th {:style {:border "1px solid white" :background-color "black"}}
:table-state table-state
:scroll-height "80vh"
:column-model columns
:row-key row-key-fn
:render-cell cell-fn
:sort sort-fn
;:caption [:caption "Test caption"]
:column-selection {:ul
{:li {:class "btn"}}}
}]]
https://github.com/Frozenlock/reagent-table