Skip to content

Commit

Permalink
feat(demo): add demo for testing grid.autosizeColumns fn, ref 6pac#264
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored and Lasse Hyyrynen committed Dec 19, 2018
1 parent fe847df commit 886d6d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/example-grid-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ <h2>Demonstrates:</h2>
<li>Optional title for the columns list (bottom section)</li>
<li>To dismiss the Grid Menu, user can click on the "x" on top right corner or anywhere outside of the Grid Menu</li>
<li>Possibility to attach the Grid Menu to an external button (try clicking on the button below).</li>
<li>You can also use some events like "onMenuClose()" and to trigger a resize of the columns with "autosizeColumns()" when "forceFitColumns: false"</li>
<p>
<button onclick="toggleGridMenu(event)"><img src="../images/drag-handle.png"/> Grid Menu</button>
</p>
Expand Down Expand Up @@ -84,7 +85,7 @@ <h2>View Source:</h2>
showHeaderRow: true,
headerRowHeight: 30,
explicitInitialization: true,
forceFitColumns: true,
forceFitColumns: false,
alwaysShowVerticalScroll: true, // this is necessary when using Grid Menu with a small dataset

// gridMenu Object is optional
Expand Down Expand Up @@ -240,6 +241,7 @@ <h2>View Source:</h2>
// subscribe to event when menu is closing
gridMenuControl.onMenuClose.subscribe(function(e, args) {
console.log('Menu is closing');
grid.autosizeColumns();
});

})
Expand Down

0 comments on commit 886d6d9

Please sign in to comment.