FAQ
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">
&nbsp;
</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 clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Search Discussions

  • Eric Harris-Braun at Oct 11, 2011 at 2:04 am
    Well, I figured it out. It was working just fine. The "problem" was
    that the Options/MenuItems are added elsewhere to the dom. I didn't
    have the css loading so I just didn't notice that they were at the
    very bottom of the screen.
    On Oct 10, 9:25 pm, Eric Harris-Braun wrote:
    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">
    &nbsp;
    </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/se...

    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 clojure@googlegroups.com
    Note that posts from new members are moderated - please be patient with your first post.
    To unsubscribe from this group, send email to
    clojure+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/clojure?hl=en

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupclojure @
categoriesclojure
postedOct 11, '11 at 1:25a
activeOct 11, '11 at 2:04a
posts2
users1
websiteclojure.org
irc#clojure

1 user in discussion

Eric Harris-Braun: 2 posts

People

Translate

site design / logo © 2022 Grokbase