make cells as wide as its content
I have a big data-set (5k+ rows, 100+ columns) that I'm displaying via ui-grid. Performance is much (LOTS) better than ng-repeat 👍
So I want my table to be horizontally scrollable and have each column to have the width of it's content and as it's a table => have each column the widest with that one of it's cells content has. TL:DR I don't want any content to be eclipsed.
But as our columns are dynamic, I don't have a column definition where you'd specify width: "*" for each column. Is there a way to do this for all columns? To have the max size of it's contents?
Hi ,I have the same issue, if i have 1000+ rows with 10 to 30 columns it works fine but if i have 10 rows with 200+ columns it rendering after 2 to 3 minute. some time while horizontal scrolling the data is not visible. some time page become unresponsive.
did you find any solution , or any one have solution please share to us.
I don't think we have the same problem. Anyway I solved mine by adding multiple watchers on UI changes and then trigger something like this:
// view changed, recalculate dimensions
$timeout(function() {
$scope.calcDimensions();
if($scope.gridApi) {
$scope.gridApi.core.handleWindowResize();
}
}, 20);
The calcDimensions column sets the width and height of the container of ui-grid.
It's still not perfect, but it renders fast and the table looks good 98% of the time.