I am trying to make calls to the jquery-ui from scala.js. I have tried modifying the way the jquery library is implemented but without success so far. So I have defined the following trait and package object:
trait JQueryUI extends js.Object {
def apply(selector: String): JQueryUI = ???
val buttonset: js.Any = ???
}
package object jqueryui extends js.GlobalScope {
val jQueryUI: JQueryUI = ???
}
And then added a JSApp as follows:
object JQueryUIApp extends JSApp {
def main(): Unit = {
jqueryui.jQueryUI("#sports").buttonset
}
}
But on my JavaScript console I get the following error:
TypeError: ScalaJS.g["jQueryUI"] is not a function (0, ScalaJS.g["jQueryUI"])("#sports")["buttonset"]
Can someone tell me what I am missing?