-
Notifications
You must be signed in to change notification settings - Fork 0
/
aggrid.cljs
executable file
·28 lines (24 loc) · 1.03 KB
/
aggrid.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(ns pinkgorilla.ui.data.aggrid
(:require
["ag-grid-react" :as rs :refer [AgGridReact]]
; ["ag-grid-community/dist/styles/ag-grid.css"]
; ["ag-grid-community/dist/styles/ag-theme-balham.css"]
[pinkie.pinkie :refer-macros [register-component]]
[pinkgorilla.ui.config :refer [link-css]]))
;node_modules/ag-grid-community/dist/styles/
(defn ^{:category :data}
aggrid
"displays a seq in a table, uses ag-grid
[aggrid {:columnDefs [{:headerName \"Make\" :field \"make\"}
{:headerName \"Model\" :field \"model\"}
{:headerName \"Price\" :field \"price\"}]
:rowData [{:make \"Toyota\" :model \"Celica\" :price 35000}
{:make \"Ford\" :model \"Mondeo\" :price 32000}
{:make \"Porsche\" :model \"Boxter\" :price 72000}]}]
"
[data]
[:<>
[link-css "ag-grid-community/dist/styles/ag-grid.css"]
[link-css "ag-grid-community/dist/styles/ag-theme-balham.css"]
[:> AgGridReact data]])
(register-component :p/aggrid aggrid)