Angular动态表上的Jquery表分类器 [英] Jquery table sorter on Angular dynamic table

查看:60
本文介绍了Angular动态表上的Jquery表分类器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,我需要使用Jquery Tablesorter插件进行排序等等。

I have a table that I required to use Jquery Tablesorter plugin to sort, amongst other things.

它适用于静态表,但是当我尝试在Angular支持的表上使用时,它不起作用。

It works fine for static tables, but when I try to use on a Angular backed table, it does not work.

有谁知道为什么会这样?

Does anyone know why that might be?

http://plnkr.co/edit/SUjs1h7prI3Xr8V2wiCP?p=preview

表格如下所示:

<table border="1" class="events-table">
  <thead>
    <tr>
      <th>Name</th>
      <th>Location</th>
      <th>Date</th>
    </tr>
  </thead>
  <tbody>
    <tr ng-repeat="item in data">
      <td>{{ item.Fields["{BB2389F3-555B-4FC6-B106-C0A23A55A15F}"].Value }}</td>
      <td>{{ item.Fields["{123A77C7-07D5-4CAA-85E0-8F9B9CEE110C}"].Value }}</td>
      <td>{{ item.Fields["{B588A80F-A8C0-4A97-A35A-07D81ED53E9B}"].Value | formatData}}</td>
    </tr>
    <tr ng-if="data.length === 0">
      <td colspan="3">There are no events available to you.</td>
    </tr>
  </tbody>
</table>


推荐答案

这是执行它的指令:

$scope.data = filteredItems;
            console.log('success ');
            setTimeout(function(){
               $(".events-table").tablesorter({
                      widgets: ["zebra", "stickyHeaders"],
                      widgetOptions: {}
                });
            }, 500)

这篇关于Angular动态表上的Jquery表分类器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆