我正在用AngularJS和Bootstrap 3创建一个应用程序。我想显示一个有数千行的表/网格。什么是AngularJS & Bootstrap中最好的控件,具有排序、搜索、分页等功能。
当前回答
After trying out ngGrid, ngTable, trNgGrid and Smart Table, I have come to the conclusion that Smart Table is by far the best implementation AngularJS-wise and Bootstrap-wise. It is built exactly the same way as you would build your own, naive table using standard angular. On top of that, they have added a few directives that help you do sorting, filtering etc. Their approach also makes it quite simple to extend yourself. The fact that they use the regular html tags for tables and the standard ng-repeat for the rows and standard bootstrap for formatting makes this my clear winner.
他们的JS代码依赖于angular,而你的html可以依赖于bootstrap。JS代码总共是4 kb,如果你想要达到更小的占用空间,你甚至可以轻松地从那里挑选东西。
其他网格会让你在不同的区域感到幽闭恐惧,智能表只是感觉开放和点睛。
如果你非常依赖内联编辑和其他高级功能,你可能会使用ngTable更快地启动和运行。但是,您可以在Smart Table中轻松地添加这些特性。
不要错过智能桌!!
我和智能桌没有任何关系,除了我自己用过它。
其他回答
你可以使用bootstrap类并使用ng-repeat指令建立一个表
例子:
angular.module('App', []); function ctrl($scope) { $scope.items = [ ['A', 'B', 'C'], ['item1', 'item2', 'item3'], ['item4', 'item5', 'item6'] ]; } <link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <div ng-app="App"> <div ng-controller="ctrl"> <table class="table table-bordered"> <thead> <tr> <th ng-repeat="itemA in items[0]">{{itemA}}</th> </tr> </thead> <tbody> <tr> <td ng-repeat="itemB in items[1]">{{itemB}}</td> </tr> <tr> <td ng-repeat="itemC in items[2]">{{itemC}}</td> </tr> </tbody> </table> </div> </div>
生活例子: http://jsfiddle.net/choroshin/5YDJW/5/
更新:
或者你可以尝试流行的ng-grid, ng-grid很适合排序、搜索、分组等,但我还没有在大规模数据上测试过。
Adapt-Strap。这是小提琴。
它非常轻,并具有动态行高。
<ad-table-lite table-name="carsForSale"
column-definition="carsTableColumnDefinition"
local-data-source="models.carsForSale"
page-sizes="[7, 20]">
</ad-table-lite>
一个特性丰富的Angular网格是:
trNgGrid
它的一些特点:
以简洁为设计理念。 正在使用普通HTML表,允许浏览器优化呈现。 完全声明性的,保持关注点的分离,从而允许您在HTML中完整地描述它,而不会弄乱控制器。 可以通过模板和双向数据绑定属性进行完全定制。 易于维护,使用TypeScript编写代码。 有一个非常短的依赖列表:AngularJs和Bootstrap CSS,带有可选的bootwatch主题。
享受。是的,我是作者。我受够了所有的Angular网格。
剑道网格和Wijmo一样好。我知道Kendo的数据源有Angular绑定,Wijmo也有Angular插件。不过,它们都不是免费的。
After trying out ngGrid, ngTable, trNgGrid and Smart Table, I have come to the conclusion that Smart Table is by far the best implementation AngularJS-wise and Bootstrap-wise. It is built exactly the same way as you would build your own, naive table using standard angular. On top of that, they have added a few directives that help you do sorting, filtering etc. Their approach also makes it quite simple to extend yourself. The fact that they use the regular html tags for tables and the standard ng-repeat for the rows and standard bootstrap for formatting makes this my clear winner.
他们的JS代码依赖于angular,而你的html可以依赖于bootstrap。JS代码总共是4 kb,如果你想要达到更小的占用空间,你甚至可以轻松地从那里挑选东西。
其他网格会让你在不同的区域感到幽闭恐惧,智能表只是感觉开放和点睛。
如果你非常依赖内联编辑和其他高级功能,你可能会使用ngTable更快地启动和运行。但是,您可以在Smart Table中轻松地添加这些特性。
不要错过智能桌!!
我和智能桌没有任何关系,除了我自己用过它。
推荐文章
- AngularJS:工厂和服务?
- 父ng-repeat从子ng-repeat的访问索引
- AngularJS使用ng-class切换类
- 如何在Angular.js中配置不同的环境?
- 当使用ng-model时,输入文本框上的Value属性被忽略?
- 推特引导3.0我如何“徽章徽章重要”现在
- 使用AngularJS跟踪谷歌分析页面视图
- 在“DOMWindow”上执行“postMessage”失败:https://www.youtube.com !== http://localhost:9000
- Angular中相当于AngularJS $watch的东西是什么?
- AngularJS路由不带散列“#”
- 单击表单中的按钮会刷新页面
- 典型的AngularJS工作流程和项目结构(使用Python Flask)
- 在Angular 1.2+中如何使用$sce.trustAsHtml(string)来复制ng-bind-html-unsafe
- IE8问题推特引导3
- Angular ng-repeat反过来