Tiny Table,如何根据两列进行初始排序

Posted

技术标签:

【中文标题】Tiny Table,如何根据两列进行初始排序【英文标题】:Tiny Table, how to initially sort based on two columns 【发布时间】:2017-03-12 07:55:23 【问题描述】:

我正在使用 tiny table V3 对表格进行排序并在表格顶部包含一个搜索框。

目前排序是基于列名 i,e 列 1 这是工作小提琴,http://jsfiddle.net/2vdh2ac8/3/ 下面是我根据名称排序后得到的结果。

no. name    due date    comment
97  bob     01/16   this is a comment
912 daisy   01/14   this is a comment
15  hahaza  09/16   this is a comment
234 hoppy   01/16   this is a comment
56  ishmael 02/18   this is a comment
24  john    04/16   this is a comment
43  john    01/16   this is a comment
365 kindle  05/15   this is a comment
123 pickpic 06/16   this is a comment

我想要实现的是,在基于名称排序之后,如果名称重复,那么我必须根据截止日期对这些名称进行排序。 因此,例如 john 在表中出现了两次,因此我需要如下输出

no. name    due date    comment
97  bob     01/16   this is a comment
912 daisy   01/14   this is a comment
15  hahaza  09/16   this is a comment
234 hoppy   01/16   this is a comment
56  ishmael 02/18   this is a comment
43  john    01/16   this is a comment
24  john    04/16   this is a comment
365 kindle  05/15   this is a comment
123 pickpic 06/16   this is a comment 

需要帮助来弄清楚如何去做。

【问题讨论】:

【参考方案1】:

在下载了插件的source code 并通过jsbeautifier 运行它以取消缩小它以便我可以阅读它之后,看来你想要实现的目标对于这个插件来说是不可能的。

排序列的选项需要一个整数,并且只能处理它。

我猜你最好的机会是要么不支持对多列进行排序,要么寻找另一个包含此功能的插件。

【讨论】:

以上是关于Tiny Table,如何根据两列进行初始排序的主要内容,如果未能解决你的问题,请参考以下文章

mat-table重置mat-sort到初始状态

Tiny64140之初始化时钟

如何在python中对两列进行透视和排序?

CreateCriteria 对两列组合进行排序

根据两个不同表上的两列对完全连接进行排序

如何根据两列在熊猫数据框中自定义排序?