is there any way to apply the height of the row in ng-grid according to its content. there is one option rowHeight which is changed the height of all row. But I want dynamic
Researching this discovered that in my fix should call anonymous function $scope.resizeViewPort whenever it makes change to ngGrid data or should be called whenever the viewport rows are updated.
Examples are after angular performs updates to the rows via data from the ng-grid module. I've found these steps useful in my anonymous function for height only:
$scope.resizeViewPort = function { // and the two steps below
// retrieve viewPortHeight
var viewportHeight = $('ngViewPort').height();
var gridHeight = $('ngGrid').height();
// set the .ngGridStyle or the first parent of my ngViewPort in current scope
var viewportHeight = $('.ngViewport').height();
var canvasHeight = $('.ngCanvas').height();
var gridHeight = $('.ngGrid').height();
alert("vp:" + viewportHeight + " cv:" + canvasHeight + " gh:" + gridHeight);
var finalHeight = canvasHeight;
var minHeight = 150;
var maxHeight = 300;
// if the grid height less than 150 set to 150, same for > 300 set to 300
if (finalHeight < minHeight) {
finalHeight = minHeight;
} else if (finalHeight > viewportHeight) {
finalHeight = maxHeight;
}
$(".ngViewport").height(finalHeight);
}