File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,23 @@ angular.module('ui.grid').directive('uiGrid',
210210 var footerHeight = grid . options . showFooter ? grid . options . footerRowHeight : 0 ;
211211 var scrollbarHeight = grid . options . enableScrollbars ? gridUtil . getScrollbarWidth ( ) : 0 ;
212212
213- var newHeight = headerHeight + contentHeight + footerHeight + scrollbarHeight ;
213+ var maxNumberOfFilters = 0 ;
214+ // Calculates the maximum number of filters in the columns
215+ angular . forEach ( grid . options . columnDefs , function ( col ) {
216+ if ( col . hasOwnProperty ( 'filter' ) ) {
217+ if ( maxNumberOfFilters < 1 ) {
218+ maxNumberOfFilters = 1 ;
219+ }
220+ }
221+ else if ( col . hasOwnProperty ( 'filters' ) ) {
222+ if ( maxNumberOfFilters < col . filters . length ) {
223+ maxNumberOfFilters = col . filters . length ;
224+ }
225+ }
226+ } ) ;
227+ var filterHeight = maxNumberOfFilters * headerHeight ;
228+
229+ var newHeight = headerHeight + contentHeight + footerHeight + scrollbarHeight + filterHeight ;
214230
215231 $elm . css ( 'height' , newHeight + 'px' ) ;
216232
You can’t perform that action at this time.
0 commit comments