简体   繁体   English

带有jQuery Accordian的AngularJS ng表固定标头

[英]AngularJS ng-table fixed headers with jquery accordian

I'm using angular js ng-table to display some information. 我正在使用angular js ng表显示一些信息。 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表的标题,而且我需要在ng表之前放置一个手风琴。

When I collapse the accordion my ng-table fixed header does not work properly. 当我折叠手风琴时,我的ng表固定标头无法正常工作。 Please refer plunker I have created : "http://plnkr.co/edit/FGjU46cCMuhIdyacffHl?p=preview" 请参考我创建的插件: "http://plnkr.co/edit/FGjU46cCMuhIdyacffHl?p=preview"

Problem with existing code is stickyTableHeaders() calculations for fixed header are not getting updated on accordion expand collapse. 现有代码的问题是,固定标头的stickyTableHeaders()计算在手风琴展开折叠时未得到更新。

Only way to fix the issue is disable accordion animation and then apply stickyTableHeaders() function in callbacks by JQuery UI accordion like below : 解决此问题的唯一方法是禁用手风琴动画,然后通过JQuery UI手风琴在回调中应用stickyTableHeaders()函数,如下所示:

 $( "#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. 您需要禁用动画,因为没有为动画事件提供回调。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM