问题描述
我采用了棱角分明的js NG-表中显示的一些信息。我想提出固定滚动bar.Moreover的NG-表的标题,我需要将一个手风琴只是NG-表之前。
I'm using angular js ng-table to display some information. I would like to make the header of the ng-table fixed with scroll bar.Moreover I need to place one accordion just before the ng-table.
在我崩溃的手风琴我NG表固定头不能正常工作。
详情请参阅我已经创建plunker:http://plnkr.co/edit/FGjU46cCMuhIdyacffHl?p=$p$pview
When I collapse the accordion my ng-table fixed header does not work properly.Please refer plunker I have created : "http://plnkr.co/edit/FGjU46cCMuhIdyacffHl?p=preview"
推荐答案
与现有的code问题是stickyTableHeaders()计算固定头都没有得到更新手风琴扩大崩溃。
Problem with existing code is stickyTableHeaders() calculations for fixed header are not getting updated on accordion expand collapse.
只是为了解决这个问题的办法是禁用手风琴动画,然后通过JQuery用户界面手风琴像下面适用stickyTableHeaders()函数在回调中:
Only way to fix the issue is disable accordion animation and then apply stickyTableHeaders() function in callbacks by JQuery UI accordion like below :
$( "#accordion" ).accordion({
collapsible: true,
animate :false,
activate: function( event, ui ) {
$('.table').stickyTableHeaders({ scrollableArea: container, "fixedOffset": 2 });
},
beforeActivate: function( event, ui ) {
$('.table').stickyTableHeaders({ scrollableArea: container, "fixedOffset": 2 })
}
});
您需要禁用动画,因为没有提供动画事件回调。
You need to disable animation because there is no callback provided for animate event.
这篇关于AngularJS NG表头固定使用jQuery手风琴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!