Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion demo/nested.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h1>Nested grids demo</h1>
<br><br>
<!-- grid will be added here -->
</div>

<script src="events.js"></script>
<script type="text/javascript">
let sub1 = [ {x:0, y:0}, {x:1, y:0}, {x:2, y:0}, {x:3, y:0}, {x:0, y:1}, {x:1, y:1}];
let sub2 = [ {x:0, y:0}, {x:0, y:1, w:2}];
Expand Down Expand Up @@ -79,6 +79,13 @@ <h1>Nested grids demo</h1>
// create and load it all from JSON above
let grid = GridStack.addGrid(document.querySelector('.container-fluid'), options);

// add debug event handlers to each grid (no global set on parent yet)
let gridEls = GridStack.getElements('.grid-stack');
gridEls.forEach(gridEl => {
let grid = gridEl.gridstack;
addEvents(grid, grid.opts.id);
})

function addNested() {
grid.addWidget({x:0, y:100, content:"new item"});
}
Expand Down