Вопрос

I am trying to run the bootstrap datepicker: http://www.eyecon.ro/bootstrap-datepicker/ in clojurescript, but always get an "undefined function" error when executing this code:

(let [elem (sel1 :#dateid)]
  (.datepicker elem))

I use dommy for selection of the dom element.

I setup a smallest not working example here: https://github.com/sveri/cljs-datepicker You can check it out and start it with: lein ring server and lein cljsbuild auto, then go to: localhost:3000

The answer is most probably pretty simple, but I just dont get it working. Any help is appreciated.

Best Regards, Sven

Это было полезно?

Решение

You need to use $ jquery function and string selector:

(let [elem (js/$ "#dateid")]
  (.datepicker elem))
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top