Skip to content
Permalink
Browse files
Grid: added heightStyle option, defaults to auto so grid grows and sh…
…rinks to fit rows as they're added and removed.
  • Loading branch information
rdworth committed Sep 29, 2011
1 parent 683ed79 commit 1554074
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
@@ -86,6 +86,7 @@
});

$( "#developers-local" ).grid({
heightStyle: "fill",
source: developers.result,
select: function( event, ui ) {
console.log( "Selected " + ui.item.firstName );
@@ -13,8 +13,9 @@
$.widget( "ui.grid", {

options: {
dataFields: [ "type", "editor", "editorOptions", "template", "culture", "format" ],
columns: null,
dataFields: [ "type", "editor", "editorOptions", "template", "culture", "format" ],
heightStyle: "auto",
rowTemplate: null
},

@@ -200,8 +201,10 @@ $.widget( "ui.grid", {
this.uiGrid.removeClass( "ui-grid-resizable" );
}

// Adjust body height to fill
this.uiGridBody.height( gridHeight - headHeight - footHeight );
if ( this.options.heightStyle === "fill" ) {
// Adjust body height to fill
this.uiGridBody.height( gridHeight - headHeight - footHeight );
}

// Adjust head and foot in case of visible scrollbar on body to keep columns aligned
var paddingRight,

0 comments on commit 1554074

Please sign in to comment.