1
2
My code is as below:
<div class="gridStyle" ng-grid="gridOptions" ng-show="flag"></div>
when i set the flag to true, the grid cannot render correctly, if you press F12 on the keyboard, it can show correctly!
ng-grid and ui-grid don’t automatically update the table when hidden or shown. By calling gridApi.core.refresh();
(for ui-grid) and gridOptions.ngGrid.buildColumns();
(for ng-grid) you force the library to rebuild the table according to the current DOM situation
While I realize this question has aged, none of the solutions worked for me as of today. However, using the ui-grid-auto-resize attribute on my element worked like a charm.
<div ui-grid="gridOptions" class="grid" ui-grid-auto-resize></div>
As per the docs ui-grid.info/docs/#/tutorial/108_hidden_grids setting a width and height worked for me. –
vanzylv
Oct 24 ’16 at 12:20
i also find a solution: use ng-if
instead of ng-show
/ng-hide
, like this:
<div class="gridStyle" ng-grid="gridOptions" ng-if="flag"></div>
Using ng-if
also fiexed it for me!
更多信息,请查看我的stackoverflow: http://stackoverflow.com/questions/33122848/ui-grid-cannot-rendered-correctly-when-using-ng-show-ng-hide-if-you-press-f12-o
1
2
|
My code is as below:
when i set the flag to true, the grid cannot render correctly, if you press F12 on the keyboard, it can show correctly! |
||
ng-grid and ui-grid don’t automatically update the table when hidden or shown. By calling |
|||||||||||||||||
|
While I realize this question has aged, none of the solutions worked for me as of today. However, using the ui-grid-auto-resize attribute on my element worked like a charm.
|
|||||||||
|
i also find a solution: use
Using |
|||
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/164238.html
Vino Dang
Oct 14 ’15 at 10:27
Ori Price
Oct 14 ’15 at 10:32
valepu
Oct 14 ’15 at 11:40
Vino Dang
Oct 15 ’15 at 3:37
Vino Dang
Oct 15 ’15 at 3:55