question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Data get sorted locally even with remote sorting

See original GitHub issue

https://github.com/AllenFang/react-bootstrap-table/blob/97171e1c0d7ad7291746ff594fc6c97e03348919/src/BootstrapTable.js#L281

When using a remote data source and remote sorting, react bootstrap table still sorts the data locally even though it should not. I think the bug is located in BootstrapTable.js line 281 (in componentWillReceiveProps) and should probably be something like this:

if (!this.allowRemote(Const.REMOTE_SORT)){
  data = this.store.sort().get();
}
newState.data = data;

I’m not completely familiar with that part of the code so the fix proposal might not be the right one.

I think the previous condition block (the if (this.store.isOnFilter) { ... }) probably need the same kind of logic checking for support of Const.REMOTE_FILTER.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
AllenFangcommented, Nov 8, 2017

sure, this will be fixed on next release.

1reaction
dawnmistcommented, Nov 12, 2017

I think something went wrong with the 4.1.3 release - looking at the compiled code in lib in the released package, it doesn’t contain the fix you added and on the page the table still shows only the “no data” message in the table.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jqGrid Remote Data, Sort Locally
Even if you sort locally, you still need to sort remotely too so that loaded remote data will match the grid's current sort...
Read more >
How to sort data locally with remote paging
Hello, I am using dxDataGrid and following requirements. dxDataGrid with infinite scrolling from remote server. I am using ASP.
Read more >
When remote is set to true a sorted table is reset to default ...
I have remote filtering enabled, but still want to use local sorting. ... data = this.store.page(page, sizePerPage).get(); }
Read more >
Sorting a column AFTER render fuction with server-side.
Hi all ! I have been trying to make a data reorder work for several days, but even though I have given up,...
Read more >
Ext JS to React: Load, Sort and Filter Data with React
Loading remote data and sorting and filtering that data is simple using ... or even on the List 's state to sort either...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found