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:
515515
516516``` js
517517let 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' );
520521```
521522### ` makeSubGrid(el) `
522523Used to add a subgrid into an existing grid.
523524``` js
524525const 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>
531532grid .makeSubGrid (grid .el .getElementById (' nested-grid' ))
532533```
533534Make 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 {
10621062 *
10631063 * @example
10641064 * 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>';
10671066 * grid.makeWidget('1');
10681067 * grid.makeWidget('2', {w:2, content: 'hello'});
10691068 */
You can’t perform that action at this time.
0 commit comments