Here's a component I'm rendering at the end of each row of a table. The tooltip portion is not working.
How can I attach Bootstrap tooltips to each component after it renders?
(defn edit-button-component []
(fn [attrs]
^{:component-did-mount #(.tooltip ($ %) (clj->js {:title "Test"}))}
[:button.btn.btn-default attrs
[:span.glyphicon.glyphicon-pencil]]))
In addition to @myguidingstar explanation on accessing
js/$
and the DOM node, it seems your metadata was not at the right place. It needs to be on the function, not the vector.Here is an implementation that works for me:
Also make sure jquery is loaded before your app.js in your html file.