留言板

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

Madasamy P,修改在7 年前。

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

Junior Member 帖子: 90 加入日期: 16-7-27 最近的帖子
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,修改在7 年前。

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

New Member 帖子: 2 加入日期: 13-3-13 最近的帖子
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,修改在7 年前。

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

Regular Member 帖子: 127 加入日期: 13-2-25 最近的帖子
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,修改在7 年前。

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

New Member 帖子: 2 加入日期: 13-3-13 最近的帖子
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,修改在6 年前。

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

New Member 发布: 1 加入日期: 16-12-29 最近的帖子
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!