ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.04k stars 1.2k forks source link

Uncaught TypeError: Cannot read property 'defaults' of undefined #442

Open antonywest opened 9 years ago

antonywest commented 9 years ago

Hello,

I am having this error occur trying to use gridster. What is is this/how can it be fixed?

Uncaught TypeError: Cannot read property 'defaults' of undefined

ajmajma commented 9 years ago

That's necessarily a gridster bug, that's a general javascript/jquery bug - you probable have something called "thing".defaults that is not defined.

antonywest commented 9 years ago

No there is nothing in my html with the class .defaults. The error appears to be coming from jquery.gridster.js

ajmajma commented 9 years ago

it's not an html class, its a javascript problem. It means somewhere in javascript or jquery you are calling something incorrectly, check for variable typos, or if you are pulling data in with ajax (or something similar) make sure it is actually coming in. It means you have (something) then . then "defaults", so something.defaults where the something is not correctly defined.

babaganoush commented 9 years ago

Having the same issue

babaganoush commented 9 years ago

The error appears to be coming from jquery.gridster.js

tollus commented 9 years ago

I would assume it's the "Draggable.defaults" at https://github.com/ducksboard/gridster.js/blob/master/src/jquery.gridster.js#L47, make sure you include jquery draggable.

orendzi commented 9 years ago

It helped me to change the order of scripts in html: jquery.draggable.js and other files should be before the jquery.gridster.js