Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data get sorted locally even with remote sorting #1737

Closed
jfremy opened this issue Nov 7, 2017 · 20 comments
Closed

Data get sorted locally even with remote sorting #1737

jfremy opened this issue Nov 7, 2017 · 20 comments
Labels

Comments

@jfremy
Copy link
Contributor

jfremy commented Nov 7, 2017

data = this.store.sort().get();

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.

@AllenFang AllenFang added the bug label Nov 8, 2017
@AllenFang
Copy link
Owner

@jfremy I'll check it soon

@AllenFang
Copy link
Owner

However, in the block of if (this.store.isOnFilter) { ... }, it will call the handleXXX function, in those function, we already check is remote or not.

@HomelessSamurai
Copy link

I've also been stuck on this issue for the past two days and only after reading this post have finally fixed it.
The proposed solution by @jfremy has fixed the bug for me and now local sorting doesn't occur.
Can you please add this in and release an update

@AllenFang
Copy link
Owner

sure, this will be fixed on next release.

@HomelessSamurai
Copy link

Thank you. When will the next release occur?

@meet-asite
Copy link

meet-asite commented Nov 9, 2017

We are also stuck due to this bug and waiting for the next release.

@AllenFang
Copy link
Owner

AllenFang commented Nov 9, 2017

11/10, I can promise it, sorry about this mistake.

@AllenFang
Copy link
Owner

Released on v4.1.2. Let me know if the problem still remain.

@meet-asite
Copy link

@AllenFang I have updated to v4.1.2. Now I am getting blank table with message: "There is no data to display" even though I have got data from the server. Could you please check?

@jfremy
Copy link
Contributor Author

jfremy commented Nov 10, 2017

Yes, I'm seeing the same.
@AllenFang the newState.data = data; part should not be inside the if (!this.allowRemote(Const.REMOTE_SORT)){ ... } block.
It must be run with or without remote sort.

@harryxu
Copy link

harryxu commented Nov 10, 2017

@meet-asite @AllenFang I am getting blank table too, after updated to v4.1.2 just now. 😅

AllenFang added a commit that referenced this issue Nov 11, 2017
@AllenFang
Copy link
Owner

I'm shame on this mistake, fixed it again and released on v4.1.3. :(

@prajapati-parth
Copy link
Contributor

@AllenFang To avoid such situations in future for react-bootstrap-table2, do you think we can have e2e tests that runs after every merge to master?

@AllenFang
Copy link
Owner

AllenFang commented Nov 11, 2017

Something we can done for unit test, e2e test I will consider, but if we have more stronger unit tests in react-bootstrap-table2, this bug will be easy to tested. So in current development for react-bootstrap-table2, I claim that we need to write tests for more detail in particular.

@dawnmist
Copy link

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.

@meet-asite
Copy link

I am still getting blank table with V4.1.3

@AllenFang
Copy link
Owner

try again on v4.1.4 and let me know if the problem still remain, thanks

@dawnmist
Copy link

Tables are displaying data properly now. :)

@meet-asite
Copy link

Thank you @AllenFang remote sorting is working properly now.

@AllenFang
Copy link
Owner

Thanks you guys. it's sorry that I make some mistake when released. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants