@@ -23,6 +23,8 @@ $.widget( "ui.grid", {
2323 . appendTo ( uiGrid ) ,
2424 uiGridBody = ( this . uiGridBody = $ ( "<div class='ui-widget-content ui-grid-body'></div>" ) )
2525 . appendTo ( uiGrid ) ,
26+ uiGridFoot = ( this . uiGridFoot = $ ( "<div class='ui-widget-header ui-grid-foot'></div>" ) )
27+ . appendTo ( uiGrid ) ,
2628
2729 // New table in grid head for column headers
2830 uiGridHeadTable = ( this . uiGridHeadTable = $ ( "<table class='ui-grid-head-table'></table>" ) )
@@ -83,18 +85,21 @@ $.widget( "ui.grid", {
8385 } ,
8486
8587 refresh : function ( ) {
88+ var gridHeight = this . uiGrid . height ( ) ,
89+ headHeight = this . uiGridHead . height ( ) ,
90+ footHeight = this . uiGridFoot . height ( ) ;
91+
92+ // Adjust body height to fill
93+ this . uiGridBody . height ( gridHeight - headHeight - footHeight ) ;
94+
8695 // Adjust head in case of visible scrollbar on body to keep columns aligned
8796 var vertScrollbar = ( this . uiGridBody [ 0 ] . scrollHeight !== this . uiGridBody [ 0 ] . clientHeight ) ;
8897 if ( vertScrollbar ) {
8998 this . uiGridHead . css ( "padding-right" , ( this . uiGridBody . width ( ) - this . uiGridBodyTable . width ( ) ) + "px" ) ;
9099 } else {
91100 this . uiGridHead . css ( "padding-right" , 0 ) ;
92101 }
93- // Adjust body height to fill
94- // TODO: create footer and calculate height
95- // ... in the meantime, fax it
96- var gridFootHeight = 20 ;
97- this . uiGridBody . height ( this . uiGrid . height ( ) - this . uiGridHead . height ( ) - gridFootHeight )
102+
98103 }
99104} ) ;
100105
0 commit comments