Open dustinbolton opened 9 years ago
First step: add a jsfiddle link to your problem. So every can see this is a bug and not wrong code of yours.
I discovered the problem was indeed mine. My HTML passed to add_widget() included a
For anyone else that encounters this issue, this is an example of HTML passed into the first parameter of add_widget() that causes this issue (note the div at the bottom):
<li class="gs-w" data-id="abcdefg" data-row="1" data-col="1" data-sizex="1" data-sizey="">
<div class="widget-head">
<div class="widget-title">Title</div>
</div>
<div class="widget-content">
My content.
</div>
</li>
<div>this causes problems</div>
Gridster is based on unordered HTML tag format is "
Calling gridster.serialize() after adding a widget via add_widget() results in the error:
Uncaught TypeError: Cannot read property 'width' of undefined in jquery-1.20.2.js:7237
Which is "val = elem.style[ name ];" in the getWidthOrHeight() method.
The HTML added by add_widget() appear accurate and the board functions fine other than adding a widget causing serialize capabilities to fail.
Any ideas on how to troubleshoot this further?