我在我的angular应用程序中使用了ng2-smart-table。由于我们要处理大量数据,因此我实现了分页基础架构,并使用ServerDataSource代替了LocalDataSource。
在对数据进行排序之前,一切都运行得很好,我不知道如何优雅地捕获排序事件并将排序(按哪个列,asc/desc)请求发送到服务器,不幸的是,文档也没有帮助。
我的NG2智能表设置:
public settings: any = {
pager: {
display: true,
perPage: this.itemsPerPage
},
actions: "false",
sort:true,
hideSubHeader: "true",
columns: {} //will be generated dynamically by the data};
我的NG2智能表组件:
<ng2-smart-table
class="report-table"
[settings]="settings"
[source]="serverDataSource">
</ng2-smart-table>有人有什么建议吗?
谢谢
发布于 2020-01-13 00:04:00
Ng2-smart-table似乎没有提供任何排序事件处理程序。
此外,你在相关的github上看到过它吗?
维护成本低
由于项目优先级和资源限制,该项目目前处于低维护状态。我们认识到围绕这个包有很多活动。然而,我们无法适应这个项目所需的维护。
我认为你应该换成像angular material table这样的表格,它提供了你需要的任何东西,而且还在维护中。你可以查看https://material.angular.io/components/table/overview,它使用起来非常简单,而且有很好的文档记录。
https://stackoverflow.com/questions/59704103
复制相似问题