Fork me on GitHub
#reagent
<
2022-11-18
>
Ryan20:11:30

Hope this is the right place: I have a react component (PrimeReact DataTable) that takes some XML for a react property, e.g. data-header = <ColumnGroup><Row><Column name=“test” field=“field”></Row></ColumnGroup> … how do I correctly set that on the cljs side? It looks like the #js literal wants a map or vector.. the documentation for the component is here: https://www.primefaces.org/primereact/datatable/colgroup/ and specifically I’m looking to set the headerGroup property, dynamically ultimately, but my first pass can be static. Thanks for help!

Ryan21:11:26

So far this has worked:

:headerColumnGroup (reagent.core/as-element [:> ColumnGroup
                             [:> Row
                              [:> Column {:header "Provider" :colSpan "1"}]
                              [:> Column {:header "Office" :colSpan "1"}]
                              [:> Column {:header "Monday, October 10,2020" :colSpan "9"}]
                              ]])
.. it’s a start.

Michaël Salihi09:11:56

FYI you can remove the double quote for number values.