Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions demo/nested.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ <h1>Nested grids demo</h1>
let sub2 = [ {x:0, y:0, h:2}, {x:1, y:1, w:2}];
let count = 0;
[...sub1, ...sub2].forEach(d => d.content = String(count++));
let subOptions = {
// by default we inherit from parent, but you can override any sub-grid options here
// column: 'auto', // DEFAULT size to match container. make sure to include gridstack-extra.min.css
};
let options = { // main grid options
staticGrid, // test - force children to inherit too if we set to true above ^^^
// disableDrag: true,
Expand All @@ -68,7 +64,7 @@ <h1>Nested grids demo</h1>
acceptWidgets: true,
id: 'main',
resizable: { handles: 'se,e,s,sw,w'},
subGridOpts: subOptions, // all sub grids will default to those
// subGridOpts, // options for all subgrids, but defaults to column='auto' now so no need.
children: [
{x:0, y:0, content: 'regular item'},
{x:1, y:0, w:4, h:4, sizeToContent: true, content: '<div>nested grid sizeToContent:true with some header content</div>', subGridOpts: {children: sub1, id:'sub1_grid', class: 'sub1'}},
Expand Down
1 change: 0 additions & 1 deletion src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ export class GridStack {
* grid.addWidget({w: 3, content: 'hello'});
*
* @param w GridStackWidget definition. used MakeWidget(el) if you have dom element instead.
* @param options widget position/size options (optional, and ignore if first param is already option) - see GridStackWidget
*/
public addWidget(w: GridStackWidget): GridItemHTMLElement {
if (typeof w === 'string') { console.error('V11: GridStack.addWidget() does not support string anymore. see #2736'); return; }
Expand Down