@@ -23,6 +23,8 @@ $.widget( "ui.grid", {
23
23
. appendTo ( uiGrid ) ,
24
24
uiGridBody = ( this . uiGridBody = $ ( "<div class='ui-widget-content ui-grid-body'></div>" ) )
25
25
. appendTo ( uiGrid ) ,
26
+ uiGridFoot = ( this . uiGridFoot = $ ( "<div class='ui-widget-header ui-grid-foot'></div>" ) )
27
+ . appendTo ( uiGrid ) ,
26
28
27
29
// New table in grid head for column headers
28
30
uiGridHeadTable = ( this . uiGridHeadTable = $ ( "<table class='ui-grid-head-table'></table>" ) )
@@ -83,18 +85,21 @@ $.widget( "ui.grid", {
83
85
} ,
84
86
85
87
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
+
86
95
// Adjust head in case of visible scrollbar on body to keep columns aligned
87
96
var vertScrollbar = ( this . uiGridBody [ 0 ] . scrollHeight !== this . uiGridBody [ 0 ] . clientHeight ) ;
88
97
if ( vertScrollbar ) {
89
98
this . uiGridHead . css ( "padding-right" , ( this . uiGridBody . width ( ) - this . uiGridBodyTable . width ( ) ) + "px" ) ;
90
99
} else {
91
100
this . uiGridHead . css ( "padding-right" , 0 ) ;
92
101
}
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
+
98
103
}
99
104
} ) ;
100
105
0 commit comments