warns about how many are visible

This commit is contained in:
Bryce Covert
2019-09-19 20:18:09 -07:00
parent dbe4c7b9c4
commit b535f73e33
2 changed files with 53 additions and 50 deletions

View File

@@ -52,7 +52,6 @@
(re-frame/reg-event-db
::change
(fn [db [_ form & path-pairs]]
(println "CHANGING" path-pairs)
(reduce
(fn [db [path value]]
(assoc-in db (into [::forms form :data] path) value))

View File

@@ -120,6 +120,9 @@
include-headers (r/atom true)
table-form (r/atom nil)]
(fn [{:keys [headings value on-change row-filter]}]
[:div
(when (> (count value) 100)
[:div.notification "Showing first 100 of " (count value)])
[:form.form
(if value
[:div
@@ -128,17 +131,18 @@
[:tr
(list
(for [[heading-name _] headings]
[:th heading-name]))
^{:key heading-name}[:th heading-name]))
(list
(for [[heading-name _] read-only-headings]
[:th heading-name]))]]
^{:key heading-name} [:th heading-name]))]]
[:tbody
(list
(for [[index row] (map vector (range )value)
(for [[index row] (map vector (range ) (take 100 value))
:when (row-filter row)]
[:tr
^{:key index} [:tr
(list
(for [[_ k] headings]
[:td
^{:key k} [:td
[:input.input {:on-change (fn [x]
(.preventDefault x)
(on-change
@@ -146,8 +150,8 @@
:value (get row k)}]]))
(list
(for [[_ k] read-only-headings]
[:td.expandable
(get row k)]))]))]
^{:key k} [:td.expandable
(get row k)]))]))]]
children]
[:div
@@ -168,7 +172,7 @@
(map (fn [[_ k] v] [k v]) headings)
(into {}))))))}
"Parse"]
])])))
])]])))
(def balance-sheet-content
(with-meta