I am trying to implement a row style such that if important columns are missing a value, then it should be red (like an alert). I have the following logic:
(defn missing-requirements? [params]
(not (every? (js->clj (.-data params)) @state/important-tags)))
And this is the main function that is being rendered
(def ag-adapter (r/adapt-react-class (.-AgGridReact js/agGridReact)))
(defn home-page []
[:div [:h2 "Ekspono tag-model"]
[:p "My portfolio / Top Index " [:a {:style {:background-color "#C0C0C0" :float "right" :color "black"}
:href "https://www.google.com" :target "_blank"} "Show problems"]]
[:div {:className "ag-theme-balham" :style {:height 200 :width 700 :color "purple"}}
[ag-adapter {:modules "AllCommunityModules"
:columnDefs @state/cols
:rowData @state/rows
:defaultColDef {:sortable true
:filter "agTextColumnFilter"
:floatingfilter true
:resizable true
:flex 1
:width deafult-col-w}
:getRowStyle (fn [params] (if (error/missing-requirements? params) {:background-color "Green"}))
:sidebars "filters"
:onGridReady (fn [params]
(:gridApi (.-api params))
(:gridColumnApi (.-columnApi params)))}]]])
Just :rowStyle {:background-color "red"} works fine. Does someone know what could be wrong? I have ag-grid-react version 21.0.1-1 as a dependency.
It was solved by adding #js as shown below
:getRowStyle (fn [params] (if (error/missing-requirements? params) #js {:background-color "Green"}))