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

Responsive Gridster (attempt) #441

Open ajmajma opened 9 years ago

ajmajma commented 9 years ago

This is not so much an issue - I'm not sure where else to post this but I have come with a very temporary solution for gridster being responsive. This does not work super well - a big heads up to those who would try this.

I set up an on window resize listener and when I hit my break points I call in the original layout (with ajax) and then destroy() and re initiate gridster, then running the layout through some logic to break down the grid responsively (break the columns down). It relies on gridster knowing what to do when stuff overlaps and works most of the time. I figured I'd put it out there and see if someone could use it, maybe even make it better.

http://jsfiddle.net/r3frvjyf/

This is just the javascript, you will need to have modnerizr(or some way of reading the screen size within the functions), gridster, and some way to call the full size arrangement data (i am using ajax)

Maybe this will spark some ideas in getting gridster responsive in a much cleaner manner! This route is by far NOT the best way, but it does (somewhat) work.

rinkurajat commented 9 years ago

https://github.com/ducksboard/gridster.js/issues/436

ajmajma commented 9 years ago

@rinkurajat awesome