2
votes

jQuery-UI is one of the third party libraries that are included with UI5. But I could not find the way to call it in a given project. My workaround is to include it in a given project folder, for instance util, and after registering the folder with localResources, I load it this way:

jQuery.sap.require("util.jQuery-ui");

Obviously, there is a better way which is to load the file that is already included with SAP UI5!
So how to do that?

2
Important: third party libs, which aren't visible in the API Reference page, are not meant to be used in application development. They can get removed in any future UI5 versions without notice. Please do not rely on them.Boghyon Hoffmann

2 Answers

2
votes

You can use the included jQuery UI version like this:

jQuery.sap.require("sap.ui.thirdparty.jqueryui.jquery-ui-core");
1
votes

👀 Important: third party libs, which aren't visible in the API Reference page, are not meant to be used in application development. They can get removed in any future UI5 versions without notice. Please do not rely on them.


Third party libs from UI5 can be retrieved mostly from the path sap/ui/thirdparty/*.

E.g. for jQuery-UI modules:

sap.ui.require([
  "sap/ui/thirdparty/jqueryui/jquery-ui-core",
  "sap/ui/thirdparty/jqueryui/jquery-ui-position",
  // ...
], function(jQueryUICore, jQueryUIPosition/*, ...*/) {
  // ...
});

Requiring them with jQuery.sap.require("sap.ui.thirdparty.jqueryui.*") is deprecated due to uses of sync XHR and global names.