5
5
Using a grid in a modal popup.
6
6
7
7
In some cases, and in particular with the bootstrap modal, you may find that your grid renders smaller than the
8
- available width (or sometimes appears to render not at all. This is believed to be because the bootstrap modal
9
- animates the initial render and the grid renders whilst the modal is still animating - the available space isn't
8
+ available width (or sometimes appears to render not at all. This is believed to be because the bootstrap modal
9
+ animates the initial render and the grid renders whilst the modal is still animating - the available space isn't
10
10
as expected. You can correct this by calling `handleWindowResize`. The animation time seems to be somewhat variable,
11
11
so the currently recommended approach is to use $interval, and to call every 500ms for the first 5s after modal opening.
12
12
@@ -25,11 +25,11 @@ In a sense this is similar to what the auto-resize feature does, but it only doe
25
25
$rootScope.gridOptions = {
26
26
onRegisterApi: function (gridApi) {
27
27
$scope.gridApi = gridApi;
28
-
29
- // call resize every 200 ms for 2 s after modal finishes opening - usually only necessary on a bootstrap modal
28
+
29
+ // call resize every 500 ms for 5 s after modal finishes opening - usually only necessary on a bootstrap modal
30
30
$interval( function() {
31
31
$scope.gridApi.core.handleWindowResize();
32
- }, 10, 500 );
32
+ }, 500, 10 );
33
33
}
34
34
};
35
35
@@ -56,7 +56,7 @@ In a sense this is similar to what the auto-resize feature does, but it only doe
56
56
$rootScope.close = function() {
57
57
modal.close();
58
58
};
59
-
59
+
60
60
$rootScope.modalStyle = {"display": "block"};
61
61
62
62
$compile(elm)($rootScope);
@@ -92,4 +92,4 @@ In a sense this is similar to what the auto-resize feature does, but it only doe
92
92
element( by.id ( 'buttonClose' ) ).click();
93
93
});
94
94
</file>
95
- </example>
95
+ </example>
0 commit comments