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

Server side search being called two times when search keyword is present #1330

Closed
mnsrulz opened this issue Mar 8, 2023 · 9 comments · Fixed by #1408
Closed

Server side search being called two times when search keyword is present #1330

mnsrulz opened this issue Mar 8, 2023 · 9 comments · Fixed by #1408

Comments

@mnsrulz
Copy link

mnsrulz commented Mar 8, 2023

Describe the bug
Server side search being called two times when search keyword is present and depending upon the race condition getting unexpected results.

To Reproduce
Steps to reproduce the behavior:

        const grid = new Grid({
            pagination: true,
            search: {
                keyword: 'back',
                server: {
                    url: (prev, keyword) => `${prev}?search=${keyword}`
                }
            },
            columns: ['Title', 'Director', 'Producer'],
            server: {
                url: 'https://swapi.dev/api/films/',
                then: data => data.results.map(movie => [movie.title, movie.director, movie.producer])
            }
        });
        grid.render(document.getElementById("wrapper"));

Open network tabs, you will two requests being issued to the server one with no search and the second with search keyword.
As you can see the first request data is rendered in the grid instead of the filtered result. It's sort of race condition too.

Expected behavior
Only one request should be made and appropriate data should be rendered in the grid.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser Brave/Chrome
  • Version Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
@marcelloh
Copy link

When will this be merged?

@stale
Copy link

stale bot commented May 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

1 similar comment
@stale
Copy link

stale bot commented Aug 10, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 10, 2023
@bruno-buiret
Copy link

Posting a message so that it won't be marked as stale/wontfix! =)

@stale stale bot removed the wontfix This will not be worked on label Aug 10, 2023
@stale
Copy link

stale bot commented Oct 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 15, 2023
@bruno-buiret
Copy link

Still looking for this

@stale stale bot removed the wontfix This will not be worked on label Oct 15, 2023
Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 15, 2023
@bruno-buiret
Copy link

Please don't mark this as stale :)

@stale stale bot removed the wontfix This will not be worked on label Dec 21, 2023
@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.

4 participants