【发布时间】:2020-06-19 10:34:00
【问题描述】:
我正在使用“引导表”API:https://bootstrap-table.com/。 我遇到的问题是我的字段设置了属性:
{field: 'price', title: 'prices', sortable: true, sorter: "customSorter"}
通过扩展,我的自定义排序器看起来像这样:
function customSorter(fieldA, fieldB) {
}
我希望能够在 customSorter 函数中访问我的行属性,因为我希望我的某些行具有特定属性(例如,如果 row.important 设置为 true)出现在顶部无论如何。我已经看到您可以使用“引导数据表”访问那些,因为自定义排序器是这样的:
function customSorter(fieldA, fieldB, rowA, rowB) {
}
但我不想为此更改,因为代码已经很庞大了,有没有我不知道的技巧可以做到这一点?
【问题讨论】:
标签: javascript bootstrap-table