grid-js / gridjs

Advanced table plugin

Home Page:https://gridjs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search only work on page 1 of a table

chowgi opened this issue · comments

commented

Describe the bug
The search works great on page 1 but if a user tries searching on any other page it won't return the results. After a failed search pagination is broken and won't allow you to go back to page 1 without clicking another page first.

To Reproduce
Steps to reproduce the behavior:

  1. Go to page 2 of a table
  2. Search for a row you know exists. You won't get a result.
  3. Clear the search by deleting the word - don't use the x button in the search input.
  4. Click the page 1 button - it won't work until you click another page then you can return to page 1

Expected behavior
expect search to work on any page and for it not to break pagination

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MaxOS
  • Browser: Safari
  • Version: 15.6.1
commented

This is a very annoying error. I hope it will be fixed as soon as possible :(

Are you using client pagination or server-side pagination?

  • If you're using client-side:

you should try setting resetPageOnUpdate to true.

  • If you're using server-side pagination:

try #1334 which should fix your issue, in such case this issue should be marked as a repeat of #1311.

Any updates on the issue? It is unfortunate that broken search is the major impact on the usage.

I, too, have run into this issue. To provide more context to the OP:

  • Using the x button of the search box instead of manually deleting the search causes the same broken behavior.
  • When the search box is clear, the original data of the (not first) selected page reappears but the pagination says it is now page 1.
  • Setting resetPageOnUpdate: true does not solve the issue.

OS: Windows (v10)
Browser: Edge (v113)

  • When the search box is clear, the original data of the (not first) selected page reappears but the pagination says it is now page 1.

I think this issue is solved by setting resetPageOnUpdate: false, but this setting does not solve the main issue.

commented

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.