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.03k stars 1.2k forks source link

Widget size update #375

Closed CorySchulz closed 10 years ago

CorySchulz commented 10 years ago

I have an issue where I'm binding directly to the DOM elements with EmberJS and it's changing the attribute values on the DOM elements to trigger resizing, which works, but then when I go to drag an element it still thinks it's the original size and the background shadow helper during drag isn't updating. Is this an issue or am I just using it wrong? I've tried using the resize_widget call and passing in values but that didn't work properly. Is there a way to resize and reposition in one call and have it actually work? Or am I better off removing the widget and readding it?

vieron commented 10 years ago

Changing DOM attribute values directly is not valid, gridster needs to update the gridmap and each widget coords.

resize_widget method should work, it will also try to reposition the widget. But there isn't a method to reposition widgets programmatically. If resize_widget doesn't work for you, please send a jsfiddle demo reproducing the issue.