Featured post

Docker setup for Liferay 7 with MySQL

Wednesday, 26 October 2016

jQuery UI with Liferay 7

If you want to integrate liferay 7 theme/portlet/application with jQuery UI, you need to make subtle change in jQuery UI library itself.

By default library starts with -

(function( factory ) {
 if ( typeof define === "function" && define.amd ) {

  // AMD. Register as an anonymous module.
  define([ "jquery" ], factory );
 } else {

  // Browser globals
  factory( jQuery );
 }
}(function( $ ) {


If you add library directly in your liferay application, you will be getting an error - Mismatched anonymous define() module:

To overcome this issue, you need to change the library like



(function( factory ) {
 
  factory( jQuery );
 
}(function( $ ) {

What you are doing is removing the reference of define call, which causes the issue, as jQuery is already loaded by default.
Same thing you need to perform for other JS libraries which contains the call.


You are just done, Try & Enjoy the function.............:)

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from JQuery Training in Chennai . or learn thru JQuery Training . or learn thru ES6 Online Training. Nowadays JavaScript has tons of job opportunities on various vertical industry.

    ReplyDelete

There was an error in this gadget