-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
After setting up my grid, I have a button that can save the placement of the tiles. It takes in the x/y coordinates, and the height/width and saves them as a json string. Then you can move the tiles around, and press the load button to bring them back to how they were saved.
Here is a fiddle to show my program:
https://jsfiddle.net/xqLfr4ja/
Reproduce problem:
Click Edit UI, then click Chart 1, then click Chart 2
Click Edit UI, then click Save
Click Edit UI, then click Load (notice all the tiles contents have been changed to the default tile)
My problem is with this line (js: 150):
myGrid.load(JSON.parse($('#tile-placement').val()), '#default-tile');
When loading the tiles in, they are always sized right, and in the correct position, but they all have the "#default-tile" contents. How can I change that to load the proper tile contents? I am assuming I need to pass the id into the json I save, but I am not sure how.