Skip to content

Setting default sort and then sorting first time always sort descending #219

Closed
@dana2208

Description

@dana2208

Hi,

I am setting a default sorting for my column this way:
<BootstrapTable data={dataSet} striped={true} hover={true} condensed={true} options={sortName: "dispName", sortOrder: Const.SORT_DESC}>
Then, first time I click on the column header of dispName, then the sorting is not changed to ascending but rather is still in descending order. I need to click again in order to get the table sorted ascendingly.
This is due to the fact that TableHeaderColumn uses a local variable (this.order) that is undefined at the beginning and only after the first click it is updated with the current sort order. Instead it should already be aware of the default sorting order.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions