I am trying to use jayq with jquery.ui.sortable to make a list on a sort page. Looking at http://jqueryui.com/demos/sortable/ , it looks like it should be as simple as that:
(.sortable ($ :
Compiles to:
jayq.core.$.call(null, "\ufdd0'#sortable").sortable();
And throws away:
Uncaught TypeError: Cannot call method 'call' of undefined
when I try to include it on the page. Interestingly, the generated code works on the page when I insert it into the js console, which implies for me something necessary is loaded after this line is executed.
I changed
(def cljs-options {:advanced {:externs ["externs/jquery.js"]}})
to
(def cljs-options {:advanced {:externs ["externs/jquery.js" "js/ui/jquery-ui.js]}})
after reading http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html , which seems to be insufficient. I assume jquery.ui modifies $ Prototype, but I'm not sure how to do this in clojurescript
I also use noir and noir-cljs if that matters.
Looking at using jQueryUI with a closure compiler , it might just be that for jquery-ui you need a manual externs file to use, possibly for a large enterprise. Can anyone confirm?
source share