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

Gridster changes col and row values of elements on init #574

Open kikozik opened 8 years ago

kikozik commented 8 years ago

I have the json saved previously by calling gridster.serialize():

[ { col:2, row:1, size_x:2, size_y:1 }, { col:1, row:2, size_x:3, size_y:1 }, { col:1, row:1, size_x:1, size_y:1 } ]

When I try to add LI elements to an empty UL by iterating through this json array I get the following expected inner html of the UL:

`

  • ` But then when I call the gridster = $(ulSelector).gridster(someOptions).data("gridster"); the inner html of the UL changes to this: `
  • ` As you can see values of the col and row attributes of the first LI get changed which result in invalid html. How can I fix that? Thanks.