Here's my clojurescript function:
(defn make-select [elem-id]
(let [select (goog.ui.Select. "Heading")
select-elem (d/element (keyword (str "div#" elem-id)))]
(.addItemAt select (goog.ui.MenuItem. "Item 1") 0)
(.addItem select (goog.ui.Option. "Item 2"))
(.render select select-elem)
select-elem))
When you add the results of a calling the above function as:
(make-select :channel)
to the DOM, it produces the following HTML in the browser:
<div id="channel">
<div class="goog-inline-block goog-menu-button" title=""
role="button" style="-webkit-user-select: none;" tabindex="0" aria-
haspopup="true" aria-pressed="false" aria-expanded="false" aria-
activedescendant="">
<div class="goog-inline-block goog-menu-button-outer-box">
<div class="goog-inline-block goog-menu-button-inner-box">
<div class="goog-inline-block goog-menu-button-caption">
Heading
</div>
<div class="goog-inline-block goog-menu-button-dropdown">
</div>
</div>
</div>
</div>
</div>
So, where are the MenuItems or Options? I can't figure out what to do
to get the items to be added! The generated Javascript looks a lot
like the code in the demo at:
http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/select.html
Any help greatly appreciated.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en