Bootstrap table 使用列选项 'order' 的列默认排序

Bootstrap table column default ordering using column options 'order'

我正在尝试使用 Json 数据填充 bootstrap table 并尝试使用列选项(不是 table 选项),如文档页面中所述:https://bootstrap-table.com/docs/api/column-options/#order
但是属性这个命令好像没有效果。我设法使用 table 选项 (sortName + sortOrder) 完成了同样的工作,但我只是想知道我是否错过了什么,或者 'order' 列选项是否没有按预期工作。这是展示我正在尝试的内容的片段:

$('#tbl_foo').bootstrapTable({
        columns: [
            {
                field: 'id',
                title: 'ID',
                sortable: true,
                order: 'desc'
            },
            {
                field: 'name',
                title: 'Name',
                sortable: true
            }
        ],
        data: data
});

以上没有按预期工作,但以下可以:

$('#tbl_foo').bootstrapTable({
        columns: [
            {
                field: 'id',
                title: 'ID',
                sortable: true
            },
            {
                field: 'name',
                title: 'Name',
                sortable: true
            }
        ],
        data: data,
        sortName: 'id',
        sortOrder: 'desc'
});

任何指点将不胜感激。

由于有一段时间没有人回应,我决定再看一遍,意识到我最初遗漏了一些东西,或者文档已经更新。 无论哪种方式,似乎都有一个与 table 选项同名的列选项 'sortName': https://bootstrap-table.com/docs/api/column-options/#sortname,必须指定它,否则 order 选项似乎无效。

P.S。我自己没有尝试过,但我认为如果 'sortName' 列选项与 'order' 列选项一起使用,这会起作用。如果没有,我将发表后续评论,但在此之前,假设这就是答案!