This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-01
Channels
- # beginners (10)
- # cljs-dev (33)
- # cljsjs (4)
- # cljsrn (12)
- # clojure (39)
- # clojure-belgium (2)
- # clojure-russia (80)
- # clojure-spec (9)
- # clojure-uk (6)
- # clojurescript (22)
- # core-async (141)
- # cursive (2)
- # datomic (20)
- # devops (1)
- # emacs (20)
- # hoplon (1)
- # jobs (3)
- # lambdaisland (12)
- # leiningen (3)
- # lumo (44)
- # onyx (2)
- # pedestal (1)
- # quil (1)
- # re-frame (9)
- # reagent (4)
- # robots (1)
- # rum (3)
- # spacemacs (5)
- # uncomplicate (80)
- # untangled (46)
- # yada (2)
Hello all, I´m trying to use http://olifolkerd.github.io/tabulator/ with re-frame and reagent, but I don´t know why the data is not being updated
(defn tabulator-mount [this]
(.tabulator (js/$ (rg/dom-node this)) (clj->js {:height 500
:fitColumns true})))
(defn tabulator-render [dados]
[:table
[:thead
[:tr
[:th {:width "200"} "Código"]
[:th "Descrição"]
[:th "Preço"]
[:th "Estoque"]
]]
[:tbody
(for [dado dados]
^{:key (:codProduto dado)}
[:tr
[:td (:codProduto dado)]
[:td (:descricao dado)]
[:td (:preco dado)]
[:td (:estoque dado)]
]
)]]
)
(defn tbl-dt [dados]
(rg/create-class
{:reagent-render #(tabulator-render dados)
:component-did-mount tabulator-mount}))
(defn ui-comp []
[:div [tbl-dt @(rf/subscribe [:dados-produto])]])
When I dispatch other datas to :dados-produto it´s not updating the datatable, what´s wrong?