I would like to use a javascript library in GWT.
I put the files in the public folder so it is shared between the client and the server and injected the javscript following this tutorial (https://pelle.io/2015/01/27/integrating-javascript-libraries-into-gwt-using-jsni/).
StyleInjector.inject(INSTANCE.fullcalendarCSS().getText());
StyleInjector.inject(INSTANCE.fullcalendarPrintCSS().getText());
StyleInjector.inject(INSTANCE.schedulerCSS().getText());
ScriptInjector.fromString(INSTANCE.jqueryJS().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
ScriptInjector.fromString(INSTANCE.momentJS().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
ScriptInjector.fromString(INSTANCE.fullcalendarJS().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
ScriptInjector.fromString(INSTANCE.scheduleJS().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
Everytime I execute my javscriptcode I get an "not a function" exception.
public static native void drawScheduler() /*-{
var calendar = $doc.getElementById("calendar");
calendar.fullCalendar({
defaultView: 'timelineMonth',
events: [
// events go here
],
resources: [
// resources go here
]
// other options go here...
});
}-*/;