Angular ng-grid footer does not adjust height according to grid

I want to reduce the height when the row is removed from ng-grid. I can remove a row that reduces the height of the grid along the row. but the mesh footer does not move from its position.

here is the code i use

- HTML

      <div class="gridStyle" ui-if="InterestInfo.length>0" ng-grid="gridOptions" ng-     style="getTableStyle()"   >

    </div>

- javascript

var varFooterTempate = '<div><button type="button" class="btn btn-xs btn-success"  ng-click="edit(row)"  > ' +
                                   ' <span class="glyphicon glyphicon-plus"></span>' +
                                '</button>'

$scope.getTableStyle = function () {
    var rowHeight = 35;
    var headerHeight = 30;
    var footerHeight = 30;
    return {
        height: ($scope.InterestInfo.length * rowHeight + headerHeight + footerHeight + 5) + "px"
    };
};


    $scope.gridOptions = {
    data: 'InterestInfo',
    headerRowHeight: 30,
    rowHeight: 35,
    footerRowHeight: 30,
    showFooter: true,
    footerTemplate: varFooterTempate,
    columnDefs: [{ field: 'name', displayName: 'Name' },
  { field: 'type', displayName: 'Type' },
  { field: 'number', displayName: 'Number' },
  { field: '', displayName: 'Action', width: 140, sortable: false, cellTemplate: editableInPopup}],
    multiSelect: false

};
$scope.removeRow = function () {


    var index = this.row.rowIndex;
    alert(index);
    $scope.gridOptions.selectItem(index, false);
    $scope.InterestInfo.splice(index, 1);
};
+3
source share
1 answer

I believe the documentation is currently not relevant to this topic. Try setting gridFooterHeight instead of footerRowHeight to your gridOptions object.

+3
source

All Articles