angularjs - How to have ng-grid extended to the full width when it's created hidden? -



angularjs - How to have ng-grid extended to the full width when it's created hidden? -

i find when ng-grid within accordion , initialized accordion closed, width of ng-grid header , rows set fixed 100px, instead of extending total width of table.

i created plunker: http://plnkr.co/edit/9grli7qtg65nknzoz3vh?p=preview

the accordion set closed default, expand , see table squeezed left. alter '$scope.isopen' true in controller , see when ng-grid not hidden when initialized, width fine.

is bug? way work around it?

it's probaby bug according this stackoverflow answer, there's workaround. width adjusted resize window, need trigger resize event using ng-click in accordion directive.

example:

controller:

$scope.resizer=function(){ $(window).trigger('resize'); }

html:

<accordion ng-click="resizer()"> <accordion-group heading="grid" is-open="isopen"> <div class="gridstyle" ng-grid="gridoptions"></div> </accordion-group> </accordion>

live example: http://plnkr.co/edit/ohrdzj25r7rn1yiubpjf?p=preview

angularjs angular-ui-bootstrap ng-grid

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -