angular-ui/ui-grid
Vedi su GitHubUI Grid column auto width, two bugs are detected (with demo)
Open
#5072 aperta il 6 feb 2016
good first issue
Metriche repository
- Star
- (5395 star)
- Metriche merge PR
- (Nessuna PR mergiata in 30 g)
Descrizione
Please read the following post on stackoverflow:
jQuery(hiddenElement).width() is always zero when hiddenElement or its parent are hidden.
Here is an approach to fix it:
// Resize the grid on window resize events
function gridResize($event) {
grid.gridWidth = $scope.gridWidth = gridUtil.elementWidth($elm);
grid.gridHeight = $scope.gridHeight = gridUtil.elementHeight($elm);
console.log(grid.gridWidth);
console.log(grid.gridHeight);
if(!$($elm).is(':hidden') && grid.gridWidth > 0) { //add such if statement before
grid.refreshCanvas(true); //this is UI Grid code
}
}