Web App Builder Developer Edition, is jQuery a supported language?

8581
4
04-02-2015 01:13 PM
CenterlineMapping
New Contributor III

In Web App Builder Developer Edition, is it possible to use jQuery to develop custom widgets, and if so, which file within the custom widget folder would we add the jQuery script tags to?  Here is the jQuery CDN libraries we would like to reference.. //code.jquery.com/jquery-1.11.2.min.js

0 Kudos
4 Replies
GuthierryAlmeida
New Contributor II

It's possible. In your "Widget.js" file use the "jimu/loaderplugins/jquery-loader":

define(['dojo/_base/declare', 'jimu/BaseWidget', 'jimu/loaderplugins/jquery-loader!https://code.jquery.com/jquery-1.11.2.min.js'],
function(declare, BaseWidget, $) {
     return declare(BaseWidget, {
          ...
     }
}
CenterlineMapping
New Contributor III

Thank you, I was not aware of this solution.

I found another solution by adding the jquery script tag into the application index.html page. 

0 Kudos
diaconori
New Contributor III

Does this still work? Can't seem to make it work with 3.37

0 Kudos
diaconori
New Contributor III

confirmed. Does work very nicely. Used it for some auto completion for one of our widgets.

0 Kudos