Forums de discussion

TypeError: $(...).fancytree is not a function

Madasamy P, modifié il y a 7 années.

TypeError: $(...).fancytree is not a function

Junior Member Publications: 90 Date d'inscription: 27/07/16 Publications récentes
Hi All,

I got this error
TypeError: $(...).fancytree is not a function when using fancy tree in my jsp

but I was already include jquery.fancytree-all.min.js to my liferay-portlet.xml

But I don't know what is the exact problem arise Could you please anyone help
thumbnail
Dharam Mali, modifié il y a 7 années.

RE: Uncaught TypeError: $(...).pickadate is not a function

New Member Publications: 2 Date d'inscription: 13/03/13 Publications récentes
I am also getting same error while using pickaDate jQuery plugin.
I have included jQuery and materialize files in my theme still getting same error.

Following file included in my Theme.
<script src="${javascript_folder}/jquery.min.js"></script>
<script src="${javascript_folder}/materialize.js"></script>
<script src="${javascript_folder}/picker.js"></script>
<script src="${javascript_folder}/picker.date.js"></script>


Code:
<script>
jQuery.noConflict();
(function( $ ) {
  $(function() {
	$('.datepicker').pickadate({
		showMonthsShort: true
	})
  });
})(jQuery);
</script>


Error:
Uncaught TypeError: $(...).pickadate is not a function


I have also tried to integrate select2 [https://select2.github.io/examples.html], it will also have same issue.
thumbnail
Chema Balsas, modifié il y a 7 années.

RE: Uncaught TypeError: $(...).pickadate is not a function

Regular Member Publications: 127 Date d'inscription: 25/02/13 Publications récentes
Hey guys,

The Using External Libraries tutorial in the Developer Network probably has the answer you're looking for.

If you're on DXP after FixPack-8 you can simply turn off the amd loader so plugins will load as you expect them again. In case you're in GA3, some workarounds are also provided.

Hope it helps!
thumbnail
Dharam Mali, modifié il y a 7 années.

RE: Uncaught TypeError: $(...).pickadate is not a function

New Member Publications: 2 Date d'inscription: 13/03/13 Publications récentes
It's working perfectly fine by just following simple steps you provided.

Updated code like this:
<script>
    define._amd = define.amd;
    define.amd = false;
</script>
<script src="${javascript_folder}/materialize.js"></script>
<script src="${javascript_folder}/picker.js"></script>
<script src="${javascript_folder}/picker.date.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
<script>
jQuery.noConflict();
(function( $ ) {
  $(function() {
    $('.mySelect').material_select();	
	$('.datepicker').pickadate({
		weekdaysShort: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
		showMonthsShort: true
	});
	$(".js-example-basic-multiple").select2();
  });
})(jQuery);
</script>
<script>
    define.amd = define._amd;
</script>


Thanks @Chema Balsas.
cihai sun, modifié il y a 6 années.

RE: Uncaught TypeError: $(...).pickadate is not a function

New Member Envoyer: 1 Date d'inscription: 29/12/16 Publications récentes
Hi, I also met same problems as you. And I wonder where should I put js files. just put under /resource or somewhere else?
Thank you!