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

Multiple server calls when sorting is enabled #1356

Closed
dor-squadded opened this issue Jun 4, 2023 · 14 comments · Fixed by #1408
Closed

Multiple server calls when sorting is enabled #1356

dor-squadded opened this issue Jun 4, 2023 · 14 comments · Fixed by #1408

Comments

@dor-squadded
Copy link

dor-squadded commented Jun 4, 2023

Describe the bug
Multiple server calls when sorting is enabled.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://gridjs.io/docs/examples/server-side-sort
  2. Open dev tools on the network tab.
  3. Use the sort on any column.
  4. See that the calls to the server are doubled when sorting.
  5. Comment out the sort: false on the images column.
  6. Use the sort on any column.
  7. See that the calls to the server are tripled.

Expected behavior
The server calls should happen only once, independant of the number of column you can sort.

Screenshots
1.
image
2.
image

Desktop (please complete the following information):

  • OS: Windows 11.
  • Browser: Chrome
  • Version: 113

Additional context
This can be problematic when dealing with a table that has 5+ columns that need to be sorted. The requests will be 5X more than needed!

@explody
Copy link

explody commented Jun 6, 2023

I just noticed something similar myself, though I'm getting an even weirder behavior:

  • sort, pagination, search are false: 2 identical queries to the server URL
  • sort, pagination are false, search is server: 3 identical queries to the server
  • if search,sort is true and pagination false, I get 5 queries.
  • if all three are true, I get six queries. The first to the baser server URL, then the next 5 including 'limit' and 'page' but all identical

In a nutshell, setting these to server for me results in anywhere from 2-6 effectively identical queries, depending on the combo.

@cyrilccs
Copy link

cyrilccs commented Jun 7, 2023

I'm facing the same issue, and it's quite concerning that such an important problem is still persisting despite the number of users of the solution.
The fact that the server is receiving 5/10 identical queries is highly inefficient.

I kindly request community help in resolving this matter.

@afshinm

@dsentker
Copy link

dsentker commented Jul 21, 2023

I can confirm this issue too with version > 6.x
Using 5.1.0 solves the issue.

Edit: Duplicate of #1317 ?

@cornonthecobb
Copy link

I am also experiencing the same issue when I do the server side post call instead of the get that uses a request body instead of the url.

@aswzen
Copy link

aswzen commented Sep 16, 2023

Any update on this?

@happybananaDev
Copy link

I have the same problem,6 columns = 6 server calls

@vinthefantastic1
Copy link

I thought I was doing something wrong. I see the same issue using 6.0.6

@vkresch
Copy link

vkresch commented Nov 13, 2023

Same issue. Any updates?

@jakecausier
Copy link

Issue also happens to me. With 10 columns, it's hammering my server with 10 requests at once!

@PLJean
Copy link

PLJean commented Dec 27, 2023

Any update on this one? I can confirm it's happening to me as well.

@BastienTwist
Copy link

Same for me with v6.0.6

@afshinm
Copy link
Member

afshinm commented Dec 30, 2023

Apologies for this issue. I have a fix for this that should address this issue and improve the overall rendering performance of the library: #1408

@dsentker
Copy link

you don't need to apologize, it's an open source library where any experienced developer could have contributed. Thank you for taking care of it 🙏

@afshinm
Copy link
Member

afshinm commented Jan 14, 2024

A new version is now available. Please try v6.1.0 https://www.npmjs.com/package/gridjs

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

Successfully merging a pull request may close this issue.