File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -515,19 +515,20 @@ Parameters:
515
515
516
516
``` js
517
517
let grid = GridStack .init ();
518
- grid .el .appendChild (' <div id="gsi-1" gs-x="0" gs-y="0" gs-w="3" gs-h="2" gs-auto-position="true"></div>' )
519
- grid .makeWidget (' #gsi-1' );
518
+ // ...create some html content, possibly looking like:
519
+ // <div id="item-1" gs-x="0" gs-y="0" gs-w="3" gs-h="2"></div>'
520
+ grid .makeWidget (' #item-1' );
520
521
```
521
522
### ` makeSubGrid(el) `
522
523
Used to add a subgrid into an existing grid.
523
524
``` js
524
525
const grid = Gridstack .init ()
525
- grid . el . appendChild ( `
526
- <div id="gsi-1" gs-x="0" gs-y="0" gs-w="3" gs-h="2" gs-auto-position="true ">
527
- <div class="grid-stack" id="nested-grid">
528
- <div id="gsi-2" gs-x="0" gs-y="0" gs- w="3" gs-h="2" gs-auto-position="true "></div>
529
- </div>
530
- </div>` )
526
+ // ...create some html content, possibly looking like:
527
+ // <div id="gsi-1" gs-x="0" gs-y="0" gs-w="3" gs-h="2">
528
+ // <div class="grid-stack" id="nested-grid">
529
+ // <div id="gsi-2" gs-w="3" gs-h="2"></div>
530
+ // </div>
531
+ // </div>
531
532
grid .makeSubGrid (grid .el .getElementById (' nested-grid' ))
532
533
```
533
534
Make sure that the subgrid is inside of a grid item. It is important to remember that subgrids are themselves grid items capable of containing other grid items.
Original file line number Diff line number Diff line change @@ -1062,8 +1062,7 @@ export class GridStack {
1062
1062
*
1063
1063
* @example
1064
1064
* const grid = GridStack.init();
1065
- * grid.el.appendChild('<div id="1" gs-w="3"></div>');
1066
- * grid.el.appendChild('<div id="2"></div>');
1065
+ * grid.el.innerHtml = '<div id="1" gs-w="3"></div><div id="2"></div>';
1067
1066
* grid.makeWidget('1');
1068
1067
* grid.makeWidget('2', {w:2, content: 'hello'});
1069
1068
*/
You can’t perform that action at this time.
0 commit comments