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
it's not the sexiest thing in the world and I doubt it's that performant but this does the trick:
function flexRowHeight() {
var self = this;
self.grid = null;
self.scope = null;
self.init = function (scope, grid, services) {
self.domUtilityService = services.DomUtilityService;
self.grid = grid;
self.scope = scope;
var adjust = function() {
setTimeout(function(){
var row = $(self.grid.$canvas).find('.ngRow'),
offs;
row.each(function(){
var mh = 0,
s = angular.element(this).scope();
$(this).find('> div').each(function(){
var h = $(this)[0].scrollHeight;
if(h > mh)
mh = h
$(this).css('height','100%');
});
$(this).height(mh)
if(offs)
$(this).css('top',offs + 'px');
offs = $(this).position().top + mh;
self.scope.$apply(function(){
s.rowHeight = mh;
});
});
},1);
}
self.scope.$watch(self.grid.config.data, adjust, true);
}
}
execute using plugins in options:
plugins: [new flexRowHeight()]