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 1554074a9c34e55791d74fb37e6074b6f772f6d2
Showing with 7 additions and 3 deletions.
  1. +1 −0 grid-spf/grid.html
  2. +6 −3 ui/jquery.ui.grid.js
@@ -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.
You can’t perform that action at this time.