This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-03
Channels
- # admin-announcements (8)
- # beginners (99)
- # boot (60)
- # cider (44)
- # cljs-dev (47)
- # cljsrn (68)
- # clojure (223)
- # clojure-art (1)
- # clojure-russia (190)
- # clojure-sg (9)
- # clojure-uk (2)
- # clojurecup (1)
- # clojurescript (59)
- # clojurex (3)
- # core-async (43)
- # core-typed (2)
- # cursive (18)
- # datavis (7)
- # datomic (16)
- # events (2)
- # funcool (3)
- # hoplon (3)
- # jobs (1)
- # lein-figwheel (10)
- # leiningen (6)
- # off-topic (1)
- # om (123)
- # onyx (57)
- # parinfer (16)
- # portland-or (2)
- # random (1)
- # re-frame (4)
- # reagent (7)
- # remote-jobs (1)
- # spacemacs (12)
Hey everyone, enjoying using reframe so far. I have a quick question about the reframe template. I am trying to make a detail panel accessible from a list view. The list view handler makes an api call which gets all the data I need but I need to find a way to send along a value to the detail panel which is an id for the detail panel to include in it's subscription (subscribe [:flow id]). Not sure how to send along a parameter using the panels setup. Im in the process of creating a new handler that accepts data (as the :set-active-panel does not) Not sure if I am thinking about this correctly or if there is a better way.
As I understand it, your view will render an item, and it needs to subscribe to that item. So when we want to render an item, we do this (perhaps in a loop,showing all items):
^{:key item-id}[item-view item-id]
And then:
(defn item-view
[id]
(let [item (subscribe [:item id])]
(fn [render-id]
(assert (= render-id id))
[:div ....use @item in here .....])))
Thanks, but how do I pass in the initial id to the panel? Im looking at both the routes and view files and wondering how I pass in something to the top level panel which can populate any let variables. I looked at the angular-cat-reframe project and I see that that is setting variables for detail-views through session parameters. I would like to avoid this if possible but im assuming it will require rewriting the panels multimethod and the related handlers
The top-level panel would subscribe to the collection of items? Or are you wondering how that collection itself is retrieved from the server?