1

I want to use daterange picker inside my portlet in liferay 7.Below are the scripts that i am loading inside my java code :

"com.liferay.portlet.header-portlet-css= //cdn.jsdelivr.net/bootstrap/3/css/bootstrap.css",
"com.liferay.portlet.header-portlet-css= //cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css",       

//MomentJS
"com.liferay.portlet.header-portlet-javascript= /js/plugins/fullcalendar/moment.min.js",
"com.liferay.portlet.header-portlet-javascript= //cdn.jsdelivr.net/momentjs/latest/moment.min.js",  
"com.liferay.portlet.header-portlet-javascript= //cdn.jsdelivr.net/jquery/1/jquery.min.js",
"com.liferay.portlet.header-portlet-javascript= //cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js",

but when i open the portlet, it says

Uncaught TypeError: $(...).daterangepicker is not a function

I have loaded all scripts as mentioned on the daterangepicker page(http://www.daterangepicker.com/) . What am i missing here?

Srijan Sharma
  • 683
  • 1
  • 9
  • 19

1 Answers1

1

You are in a trick use case, as plugin support for JQuery within liferay is somehow odd. Please, visit this post to find the answer:

jQuery plugin in a Liferay 7 theme

Victor
  • 3,520
  • 3
  • 38
  • 58