我用的是格栅。当ng网格组按某个字段时,我想添加一个按钮,用于展开/折叠所有行。我该怎么做?
发布于 2014-06-30 12:46:27
ng网格的分组部分可能有一个类.ngViewport .ng-scope。
我想这就是您想要添加折叠功能的地方。
动态添加这个div一个ng-show属性
$('.ngViewport').attr('ng-show', 'collapsed'); //This is jquery, you can use angular directives for best practice, dont have time :)分配给一个按钮。所以只要你点击,它就会切换。
<a href="#" ng-model="collapsed" ng-click="collapsed=!collapsed">Click here to <strong>Toggle (show/hide)</strong> Grid</a>https://stackoverflow.com/questions/24488660
复制相似问题